From 1880cf38b3c24274f081a6934625b43e758e33c6 Mon Sep 17 00:00:00 2001 From: Bjarne Fyrstenborg Date: Mon, 3 Aug 2020 14:29:19 +0200 Subject: [PATCH 1/6] Move umbPropertyActions controller and remove subfolder for view --- .../property}/umbpropertyactions.component.js | 22 +++++++++++-------- .../umb-property-actions.html | 7 +++--- 2 files changed, 16 insertions(+), 13 deletions(-) rename src/Umbraco.Web.UI.Client/src/{views/components/property/property-actions => common/directives/components/property}/umbpropertyactions.component.js (81%) rename src/Umbraco.Web.UI.Client/src/views/components/property/{property-actions => }/umb-property-actions.html (97%) diff --git a/src/Umbraco.Web.UI.Client/src/views/components/property/property-actions/umbpropertyactions.component.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/property/umbpropertyactions.component.js similarity index 81% rename from src/Umbraco.Web.UI.Client/src/views/components/property/property-actions/umbpropertyactions.component.js rename to src/Umbraco.Web.UI.Client/src/common/directives/components/property/umbpropertyactions.component.js index b0dc15d6cdab..ecbd527614cf 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/property/property-actions/umbpropertyactions.component.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/property/umbpropertyactions.component.js @@ -9,46 +9,50 @@ var vm = this; + vm.labels = {}; vm.isOpen = false; + + function initDropDown() { keyboardService.bind("esc", vm.close); } + function destroyDropDown() { keyboardService.unbind("esc"); } - vm.toggle = function() { + vm.toggle = function () { if (vm.isOpen === true) { vm.close(); } else { vm.open(); } - } + }; + vm.open = function() { vm.isOpen = true; initDropDown(); } - vm.close = function() { + vm.close = function () { vm.isOpen = false; destroyDropDown(); - } + }; - vm.executeAction = function(action) { + vm.executeAction = function (action) { action.method(); vm.close(); - } + }; vm.$onDestroy = function () { if (vm.isOpen === true) { destroyDropDown(); } - } - + }; } var umbPropertyActionsComponent = { - templateUrl: 'views/components/property/property-actions/umb-property-actions.html', + templateUrl: 'views/components/property/umb-property-actions.html', bindings: { actions: "<" }, diff --git a/src/Umbraco.Web.UI.Client/src/views/components/property/property-actions/umb-property-actions.html b/src/Umbraco.Web.UI.Client/src/views/components/property/umb-property-actions.html similarity index 97% rename from src/Umbraco.Web.UI.Client/src/views/components/property/property-actions/umb-property-actions.html rename to src/Umbraco.Web.UI.Client/src/views/components/property/umb-property-actions.html index 5d98517a6141..022ab66d2b7b 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/property/property-actions/umb-property-actions.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/property/umb-property-actions.html @@ -1,11 +1,11 @@
+ + label-key="propertyActions_tooltipForPropertyActionsMenu">