X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/30cd9b94ad82e3c3e1551fb8688eca6144f4a0f6..6b06b64b40cd570ab02227cc913a5204d9562f37:/src/fnpjs/actions.js?ds=sidebyside diff --git a/src/fnpjs/actions.js b/src/fnpjs/actions.js index c49373a..b8aa033 100644 --- a/src/fnpjs/actions.js +++ b/src/fnpjs/actions.js @@ -74,8 +74,13 @@ _.extend(Action.prototype, Backbone.Events, { }, execute: function() { var state = this.getState(); + + var callback = function(ret) { + this.trigger('actionExecuted', ret); + }.bind(this); + if(state.allowed) { - return state.execute.call(this, this.params, this.appObject); + return state.execute.call(this, callback, this.params, this.appObject); } throw new Error('Execution not allowed'); }