From: Aleksander Ɓukasz Date: Wed, 2 Jul 2014 07:50:16 +0000 (+0200) Subject: fnpjs: Action now triggers actionExecuted event instead of using callback X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/66dd6f9323a2ae14494a488bc1123b345d30f2c8?hp=83edceffb18f5802bb6a9b20746437a3a46f2450 fnpjs: Action now triggers actionExecuted event instead of using callback --- diff --git a/src/fnpjs/actions.js b/src/fnpjs/actions.js index f380ed6..b8aa033 100644 --- a/src/fnpjs/actions.js +++ b/src/fnpjs/actions.js @@ -72,9 +72,13 @@ _.extend(Action.prototype, Backbone.Events, { } return this._cache; }, - execute: function(callback) { + execute: function() { var state = this.getState(); - callback = callback || function() {}; + + var callback = function(ret) { + this.trigger('actionExecuted', ret); + }.bind(this); + if(state.allowed) { return state.execute.call(this, callback, this.params, this.appObject); }