X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=planetstack%2Fcore%2Fxoslib%2Fstatic%2Fjs%2Fxoslib%2FxosHelper.js;h=76254f6d16605456145fc802addc9c608325b69d;hb=753a13edfd39603fbdc59747c4d7c2b59a2d06b9;hp=a46fa4074d6f24491a38bd4400f4f7c3fd92551e;hpb=2ec7b2d3e2943eab499eabd988d8eadf5ff82a0b;p=plstackapi.git diff --git a/planetstack/core/xoslib/static/js/xoslib/xosHelper.js b/planetstack/core/xoslib/static/js/xoslib/xosHelper.js index a46fa40..76254f6 100644 --- a/planetstack/core/xoslib/static/js/xoslib/xosHelper.js +++ b/planetstack/core/xoslib/static/js/xoslib/xosHelper.js @@ -475,7 +475,7 @@ XOSDetailView = Marionette.ItemView.extend({ */ initialize: function() { - this.on("saveSuccess", this.onAfterSave); + this.on("saveSuccess", this.onSaveSuccess); this.synchronous = false; }, @@ -485,11 +485,20 @@ XOSDetailView = Marionette.ItemView.extend({ }); }, + saveSuccess: function(e) { + // always called after a save succeeds + }, + afterSave: function(e) { + // if this.synchronous, then called after the save succeeds + // if !this.synchronous, then called after save is initiated }, - onAfterSave: function(e) { - this.afterSave(e); + onSaveSuccess: function(e) { + this.saveSuccess(e); + if (this.synchronous) { + this.afterSave(e); + } }, inputChanged: function(e) { @@ -559,9 +568,7 @@ XOSDetailView = Marionette.ItemView.extend({ this.model.save(data, {error: function(model, result, xhr) { that.app.saveError(model,result,xhr,infoMsgId);}, success: function(model, result, xhr) { that.app.saveSuccess(model,result,xhr,infoMsgId); - if (that.synchronous) { - that.trigger("saveSuccess"); - } + that.trigger("saveSuccess"); }}); this.dirty = false; @@ -665,6 +672,7 @@ XOSDetailView = Marionette.ItemView.extend({ model: this.model, detailView: this, choices: this.options.choices || this.choices || this.model.choices || {}, + helpText: this.options.helpText || this.helpText || this.model.helpText || {}, }}, });