From: Scott Baker Date: Thu, 6 Nov 2014 06:13:36 +0000 (-0800) Subject: support for statusMsg in django's base.html X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=e88b25c030c8ebc66f1cf86263769bdd86ce1517;p=plstackapi.git support for statusMsg in django's base.html --- diff --git a/planetstack/core/xoslib/static/js/xoslib/xosHelper.js b/planetstack/core/xoslib/static/js/xoslib/xosHelper.js index 417f8aa..1dc3bf5 100644 --- a/planetstack/core/xoslib/static/js/xoslib/xosHelper.js +++ b/planetstack/core/xoslib/static/js/xoslib/xosHelper.js @@ -33,8 +33,8 @@ XOSApplication = Marionette.Application.extend({ }, showSuccess: function(result) { + result["success"] = "success"; if (this.logTableId) { - result["success"] = "success"; this.appendLogWindow(result); } else { $(this.successBoxId).show(); @@ -47,8 +47,8 @@ XOSApplication = Marionette.Application.extend({ }, showError: function(result) { + result["success"] = "failure"; if (this.logTableId) { - result["success"] = "failure"; this.appendLogWindow(result); } else { $(this.errorBoxId).show(); @@ -61,8 +61,8 @@ XOSApplication = Marionette.Application.extend({ }, showInformational: function(result) { + result["success"] = "information"; if (this.logTableId) { - result["success"] = "information"; return this.appendLogWindow(result); } else { return undefined; @@ -90,6 +90,11 @@ XOSApplication = Marionette.Application.extend({ logTableBody = $(this.logTableId + " tbody"); logTableBody.prepend(newRow); } + + if (this.statusMsgId) { + $(this.statusMsgId).html( templateFromId("#xos-status-template")(result) ); + } + return logMessageId; }, @@ -162,9 +167,6 @@ XOSApplication = Marionette.Application.extend({ XOSDetailView = Marionette.ItemView.extend({ tagName: "div", - events: {"click button.js-submit": "submitClicked", - "change input": "inputChanged"}, - events: {"click button.js-submit": "submitClicked", "change input": "inputChanged"}, @@ -191,6 +193,7 @@ XOSDetailView = Marionette.ItemView.extend({ }, submitClicked: function(e) { + console.log("submit clicked"); this.app.hideError(); e.preventDefault(); var infoMsgId = this.app.showInformational( {what: "save " + this.model.__proto__.modelName, status: "", statusText: "in progress..."} );