Skip to content

Commit

Permalink
fixed console problem editing or deleting a doc with a custom ID
Browse files Browse the repository at this point in the history
  • Loading branch information
giastfader committed May 30, 2015
1 parent 1dd08b3 commit 5f4bbfb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions public/console/bbjs/baasboxgui.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ var settingPushDataArray;
var refreshSessionToken;
var settingPushMap = {};

var DOC_CLASS_SEPARATOR = "___@___";

$(document).ready(function(){
setup();
Expand Down Expand Up @@ -315,8 +316,8 @@ $(".btn-action").live("click", function() {
break;
case "document":
//in this case the parameter is pair ID/COLLECTION
var id=parameters.substring(0,36);
var collection=parameters.substr(36);
var id=parameters.substring(0,parameters.indexOf(DOC_CLASS_SEPARATOR));
var collection=parameters.substr(parameters.indexOf(DOC_CLASS_SEPARATOR) + DOC_CLASS_SEPARATOR.length);
openDocumentEditForm(id,collection);
break;
case "asset":
Expand Down Expand Up @@ -365,8 +366,8 @@ $(".btn-action").live("click", function() {
break;
case "document":
//in this case the parameter is pair ID/COLLECTION
var id=parameters.substring(0,36);
var collection=parameters.substr(36);
var id=parameters.substring(0,parameters.indexOf(DOC_CLASS_SEPARATOR));
var collection=parameters.substr(parameters.indexOf(DOC_CLASS_SEPARATOR) + DOC_CLASS_SEPARATOR.length);
if(!confirm("Are you sure you want to delete the '"+ id +"' document of the collection '"+collection+"' ?"))
return;
deleteDocument(collection,id);
Expand Down
2 changes: 1 addition & 1 deletion public/console/bbjs/documents-datatable.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var documentDataArray= new Array();
},
{"mData": "id","mRender": function ( data, type, full ) {
var obj=JSON.parse(JSON.stringify(full));
return getActionButton("edit","document",data + obj["@class"]) + " " + getActionButton("delete","document",data+obj["@class"]) /*+ " " + getActionButton("acl","document",data+obj["@class"])*/;
return getActionButton("edit","document",data + DOC_CLASS_SEPARATOR + obj["@class"]) + " " + getActionButton("delete","document",data + DOC_CLASS_SEPARATOR + obj["@class"]) /*+ " " + getActionButton("acl","document",data+obj["@class"])*/;
},bSortable:false,bSearchable:false
}
],
Expand Down

0 comments on commit 5f4bbfb

Please sign in to comment.