From: Scott Baker Date: Mon, 12 Jan 2015 20:56:25 +0000 (-0800) Subject: afterDelete working in tenant view X-Git-Url: http://git.onelab.eu/?p=plstackapi.git;a=commitdiff_plain;h=dae1b82ff0077b6ad3365c34d53e34ea5e7adbf5 afterDelete working in tenant view --- diff --git a/planetstack/core/xoslib/static/js/xosTenant.js b/planetstack/core/xoslib/static/js/xosTenant.js index 6f73046..5a548ed 100644 --- a/planetstack/core/xoslib/static/js/xosTenant.js +++ b/planetstack/core/xoslib/static/js/xosTenant.js @@ -42,7 +42,7 @@ XOSTenantButtonView = Marionette.ItemView.extend({ }, deleteClicked: function(e) { - this.options.linkedView.deleteClicked.call(this.options.linkedView, e); + XOSTenantApp.deleteSlice(this.options.linkedView.model); }, addUserClicked: function(e) { @@ -156,6 +156,11 @@ XOSTenantApp.addSlice = function() { $("#tenant-addslice-dialog").dialog("open"); }; +XOSTenantApp.deleteSlice = function(model) { + var app=this; + app.deleteDialog(model, function() { console.log("afterDelete"); app.viewSlice(undefined); }); +}; + XOSTenantApp.viewSlice = function(model) { if (!model && xos.slicesPlus.models.length > 0) { model = xos.slicesPlus.models[0]; diff --git a/planetstack/core/xoslib/static/js/xoslib/xosHelper.js b/planetstack/core/xoslib/static/js/xoslib/xosHelper.js index 4ec75a6..9f9964c 100644 --- a/planetstack/core/xoslib/static/js/xoslib/xosHelper.js +++ b/planetstack/core/xoslib/static/js/xoslib/xosHelper.js @@ -400,6 +400,8 @@ XOSApplication = Marionette.Application.extend({ that.destroyModel(model); if (afterDelete=="list") { that.navigate("list", modelName); + } else if (afterDelete) { + afterDelete(); } }); }, diff --git a/planetstack/core/xoslib/templates/xosAdmin.html b/planetstack/core/xoslib/templates/xosAdmin.html index ac90e94..53b9fe6 100644 --- a/planetstack/core/xoslib/templates/xosAdmin.html +++ b/planetstack/core/xoslib/templates/xosAdmin.html @@ -228,11 +228,17 @@ - + +