From 4b51e604a75b167b0aa117095b5b9327d80d0ece Mon Sep 17 00:00:00 2001 From: Alex M Date: Sat, 24 Sep 2016 20:43:35 +0300 Subject: [PATCH 1/2] [Edit] Switch other edit actions to mct-control --- platform/commonUI/edit/bundle.js | 4 +++- .../edit/res/templates/edit-action-buttons.html | 13 +++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/platform/commonUI/edit/bundle.js b/platform/commonUI/edit/bundle.js index 60da9001769..1094abb864e 100644 --- a/platform/commonUI/edit/bundle.js +++ b/platform/commonUI/edit/bundle.js @@ -245,7 +245,9 @@ define([ "key": "cancel", "category": "conclude-editing", "implementation": CancelAction, - "name": "Cancel", + // Because we use the name as label for edit buttons and mct-control buttons need + // the label to be set to undefined in order to not apply the labeled CSS rule. + "name": undefined, "cssclass": "icon-x no-label", "description": "Discard changes made to these objects.", "depends": [] diff --git a/platform/commonUI/edit/res/templates/edit-action-buttons.html b/platform/commonUI/edit/res/templates/edit-action-buttons.html index 4bc020612f0..7c1017992aa 100644 --- a/platform/commonUI/edit/res/templates/edit-action-buttons.html +++ b/platform/commonUI/edit/res/templates/edit-action-buttons.html @@ -42,11 +42,12 @@ - - {{currentAction.getMetadata().name}} - + + \ No newline at end of file From a34e89d56a8c33cde53bd37c59e25922e272e337 Mon Sep 17 00:00:00 2001 From: Alex M Date: Tue, 27 Sep 2016 21:19:25 +0300 Subject: [PATCH 2/2] [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 7c1017992aa..2af47b68784 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 7c33799ebbd..ba91b63e9d7 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