diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/property/umbproperty.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/property/umbproperty.directive.js
index 06b9e51fba..9917b884a0 100644
--- a/src/Umbraco.Web.UI.Client/src/common/directives/components/property/umbproperty.directive.js
+++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/property/umbproperty.directive.js
@@ -15,19 +15,20 @@ angular.module("umbraco.directives")
restrict: 'E',
replace: true,
templateUrl: 'views/components/property/umb-property.html',
- link: function (scope) {
+ link: function ($scope) {
- scope.propertyEditorAPI = {};
+ $scope.propertyActions = [];
userService.getCurrentUser().then(function (u) {
var isAdmin = u.userGroups.indexOf('admin') !== -1;
- scope.propertyAlias = (Umbraco.Sys.ServerVariables.isDebuggingEnabled === true || isAdmin) ? scope.property.alias : null;
+ $scope.propertyAlias = (Umbraco.Sys.ServerVariables.isDebuggingEnabled === true || isAdmin) ? $scope.property.alias : null;
});
},
//Define a controller for this directive to expose APIs to other directives
controller: function ($scope, $timeout) {
var self = this;
+ self.propertyActions = [];
//set the API properties/methods
@@ -35,18 +36,10 @@ angular.module("umbraco.directives")
self.setPropertyError = function (errorMsg) {
$scope.property.propertyErrorMessage = errorMsg;
};
-
- var unsubscribe = $scope.$on("ExposePropertyEditorAPI", function(event, api) {
-
- //avoid eventual parent properties to capture this.
- event.stopPropagation();
-
- $scope.propertyEditorAPI = api;
- });
- $scope.$on("$destroy", function () {
- unsubscribe();
- });
+ self.setPropertyActions = function(actions) {
+ $scope.propertyActions = actions;
+ };
}
};
diff --git a/src/Umbraco.Web.UI.Client/src/views/components/property/umb-property.html b/src/Umbraco.Web.UI.Client/src/views/components/property/umb-property.html
index 927f677463..46660fc685 100644
--- a/src/Umbraco.Web.UI.Client/src/views/components/property/umb-property.html
+++ b/src/Umbraco.Web.UI.Client/src/views/components/property/umb-property.html
@@ -21,7 +21,7 @@
-
+
diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.component.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.component.js
index 03a7207720..0504e29a8b 100644
--- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.component.js
+++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.component.js
@@ -7,12 +7,13 @@
templateUrl: 'views/propertyeditors/nestedcontent/nestedcontent.propertyeditor.html',
controller: NestedContentController,
controllerAs: 'vm',
- bindings: {
-
+ require: {
+ umbProperty: '^umbProperty',
+ umbVariantContent: '?^^umbVariantContent'
}
});
- function NestedContentController($scope, $interpolate, $filter, $timeout, contentResource, localizationService, iconHelper, clipboardService, eventsService, overlayService, $routeParams, editorState, propertyEditorService) {
+ function NestedContentController($scope, $interpolate, $filter, $timeout, contentResource, localizationService, iconHelper, clipboardService, eventsService, overlayService, $routeParams, editorState) {
var vm = this;
var model = $scope.$parent.$parent.model;
@@ -65,14 +66,14 @@
// remove dublicates
aliases = aliases.filter((item, index) => aliases.indexOf(item) === index);
+
+ var nodeName = "";
- // Retrive variant name
- var culture = $routeParams.cculture ? $routeParams.cculture : $routeParams.mculture;
- var activeVariant = _.find(editorState.current.variants, function (v) {
- return !v.language || v.language.culture === culture;
- });
+ if(vm.umbVariantContent) {
+ nodeName = vm.umbVariantContent.editor.content.name;
+ }
- localizationService.localize("clipboard_labelForArrayOfItemsFrom", [model.label, activeVariant.name]).then(function(data) {
+ localizationService.localize("clipboard_labelForArrayOfItemsFrom", [model.label, nodeName]).then(function(data) {
clipboardService.copyArray("elementTypeArray", aliases, vm.nodes, data, "icon-thumbnail-list", model.id);
});
}
@@ -538,13 +539,14 @@
- var api = {};
- api.propertyActions = [
+ var propertyActions = [
copyAllEntriesAction
];
- propertyEditorService.exposeAPI($scope, api);// must be executed at a state where the API is set.
-
+ this.$onInit = function () {
+ this.umbProperty.setPropertyActions(propertyActions);
+ };
+
var unsubscribe = $scope.$on("formSubmitting", function (ev, args) {
updateModel();
});