diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/property/umbpropertyactions.component.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/property/umbpropertyactions.component.js index 41dbd9f54741..b3a46ba2b1b6 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/property/umbpropertyactions.component.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/property/umbpropertyactions.component.js @@ -22,6 +22,7 @@ vm.$onDestroy = onDestroy; vm.$onInit = onInit; + vm.$onChanges = onChanges; function initDropDown() { keyboardService.bind("esc", vm.close); @@ -72,6 +73,26 @@ vm.labels.closeText = values[1]; }); } + + function onChanges(simpleChanges) { + if (simpleChanges.actions) { + + let actions = simpleChanges.actions.currentValue || []; + + // Map action icons using legacy icon font or svg icons. + Utilities.forEach(actions, action => { + + if (action.labelKey) { + localizationService.localize(action.labelKey, (action.labelTokens || []), action.label).then(data => { + action.label = data; + }); + } + + action.useLegacyIcon = action.useLegacyIcon === false ? false : true; + action.icon = (action.useLegacyIcon ? 'icon-' : '') + action.icon; + }); + } + } } var umbPropertyActionsComponent = { diff --git a/src/Umbraco.Web.UI.Client/src/views/components/property/umb-property-actions.html b/src/Umbraco.Web.UI.Client/src/views/components/property/umb-property-actions.html index fea619f437fc..d6c798e5c37d 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/property/umb-property-actions.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/property/umb-property-actions.html @@ -11,8 +11,8 @@