From 66dd6f9323a2ae14494a488bc1123b345d30f2c8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Wed, 2 Jul 2014 09:50:16 +0200 Subject: [PATCH 1/1] fnpjs: Action now triggers actionExecuted event instead of using callback --- src/fnpjs/actions.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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); } -- 2.20.1