});
+XOSTenantSummaryView = XOSDetailView.extend({
+ events: {"change": "onChange"},
+
+ onChange: function(e) {
+ XOSTenantApp.setDirty(true);
+ },
+
+ saveSuccess: function() {
+ console.log("saveSuccess!");
+ XOSTenantApp.setDirty(false);
+ },
+
+ });
+
XOSTenantButtonView = Marionette.ItemView.extend({
template: "#xos-tenant-buttons-template",
model = this.options.linkedView.model;
model.tenantSiteCollection.putToSlice(model);
model.attributes.users = model.usersBuffer;
- this.options.linkedView.submitContinueClicked.call(this.options.linkedView, e);
+
+ e.preventDefault();
+ this.options.linkedView.save();
+ //this.options.linkedView.submitContinueClicked.call(this.options.linkedView, e);
+ //XOSTenantApp.setDirty(false);
},
});
tenantEditUsersInterior: "#tenant-edit-users-interior",
});
+XOSTenantApp.setDirty = function(dirty) {
+ if (dirty) {
+ $("button.btn-tenant-save").addClass("btn-success");
+ } else {
+ $("button.btn-tenant-save").removeClass("btn-success");
+ }
+};
+
XOSTenantApp.buildViews = function() {
XOSTenantApp.tenantSites = new XOSTenantSiteCollection();\r
\r
- tenantSummaryClass = XOSDetailView.extend({template: "#xos-detail-template",\r
+ tenantSummaryClass = XOSTenantSummaryView.extend({template: "#xos-detail-template",\r
app: XOSTenantApp,\r
detailFields: ["serviceClass", "default_image", "default_flavor", "network_ports", "mount_data_sets"],\r
fieldDisplayNames: {serviceClass: "Service Level", "default_flavor": "Flavor", "default_image": "Image", "mount_data_sets": "Data Sets"},\r
XOSTenantApp.adjustCollectionField = function(collectionName, id, fieldName, amount) {\r
model = XOSTenantApp[collectionName].get(id);\r
model.set(fieldName, Math.max(model.get(fieldName) + amount, 0));\r
+ XOSTenantApp.setDirty(true);\r
};\r
\r
XOSTenantApp.addSlice = function() {\r