putToSlice: function(slice) {
slice.attributes.site_allocation = {};
for (index in this.models) {
- model = this.models[index];
+ var model = this.models[index];
slice.attributes.site_allocation[ model.attributes.name ] = model.attributes.allocated;
}
},
saveClicked: function(e) {
model = this.options.linkedView.model;
model.tenantSiteCollection.putToSlice(model);
+ model.attributes.users = model.usersBuffer;
this.options.linkedView.submitContinueClicked.call(this.options.linkedView, e);
},
});
modal: true,
width: 640,
buttons : {
- "Save" : function() {
+ "Create Slice" : function() {
var addDialog = this;
console.log("SAVE!!!");
detailView.synchronous = true;
modal: true,
width: 640,
buttons : {
- "Save" : function() {
+ "Ok" : function() {
var editDialog = this;
user_ids = all_options($("#tenant-edit-users-dialog").find(".select-picker-to"));
user_ids = user_ids.map( function(x) { return parseInt(x,10); } );
- model.attributes.users = user_ids;
+ model.usersBuffer = user_ids;
$(editDialog).dialog("close");
},
"Cancel" : function() {
\r
tenantSites = new XOSTenantSiteCollection();\r
tenantSites.getFromSlice(model);\r
+ model.usersBuffer = model.attributes.users; /* save a copy of 'users' that we can edit. This prevents another view (developer) from overwriting our copy with a fetch from the server */\r
model.tenantSiteCollection = tenantSites;\r
XOSTenantApp.tenantSites = tenantSites;\r
\r