From a34e89d56a8c33cde53bd37c59e25922e272e337 Mon Sep 17 00:00:00 2001 From: Alex M Date: Tue, 27 Sep 2016 21:19:25 +0300 Subject: [PATCH] [Edit] Bind action to .perform() inside mct-button --- .../commonUI/edit/res/templates/edit-action-buttons.html | 4 ++-- .../commonUI/edit/src/controllers/EditActionController.js | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/platform/commonUI/edit/res/templates/edit-action-buttons.html b/platform/commonUI/edit/res/templates/edit-action-buttons.html index 7c1017992a..2af47b6878 100644 --- a/platform/commonUI/edit/res/templates/edit-action-buttons.html +++ b/platform/commonUI/edit/res/templates/edit-action-buttons.html @@ -25,7 +25,7 @@ @@ -45,7 +45,7 @@ diff --git a/platform/commonUI/edit/src/controllers/EditActionController.js b/platform/commonUI/edit/src/controllers/EditActionController.js index 7c33799ebb..ba91b63e9d 100644 --- a/platform/commonUI/edit/src/controllers/EditActionController.js +++ b/platform/commonUI/edit/src/controllers/EditActionController.js @@ -61,6 +61,12 @@ define( $scope.otherEditActions = $scope.action ? $scope.action.getActions(OTHERS_ACTION_CONTEXT) : []; + + // Required because Angular does not allow 'bind' + // in expressions. + $scope.actionPerformer = function (action) { + return action.perform.bind(action); + }; } // Update set of actions whenever the action capability