diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/umbtree.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/umbtree.directive.js index 481827bd56..0ba36efcea 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/umbtree.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/umbtree.directive.js @@ -19,7 +19,9 @@ function umbTreeDirective($compile, $log, $q, $rootScope, treeService, notificat isdialog: '@', //Custom query string arguments to pass in to the tree as a string, example: "startnodeid=123&something=value" customtreeparams: '@', - eventhandler: '=' + eventhandler: '=', + enablecheckboxes: '@', + enablelistviewsearch: '@' }, compile: function(element, attrs) { @@ -32,7 +34,7 @@ function umbTreeDirective($compile, $log, $q, $rootScope, treeService, notificat '' + ''; template += '' + '' + ''; diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/umbtreeitem.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/umbtreeitem.directive.js index b225ccaa44..37d07436c6 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/umbtreeitem.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/umbtreeitem.directive.js @@ -25,7 +25,6 @@ angular.module("umbraco.directives") scope: { section: '@', - cachekey: '@', eventhandler: '=', currentNode: '=', node: '=', @@ -33,10 +32,13 @@ angular.module("umbraco.directives") }, template: '
  • ' + - '' + + //NOTE: This ins element is used to display the search icon if the node is a container/listview and the tree is currently in dialog + '' + '' + '' + - '' + + //NOTE: If the tree supports check boxes, render different markup + '' + + '' + '' + '' + '
    ' + @@ -77,6 +79,10 @@ angular.module("umbraco.directives") }, 0, false); } + scope.selectEnabledNodeClass = function(node) { + return node.selected ? 'icon umb-tree-icon sprTree icon-check blue temporary' : node.cssClass; + }; + //add a method to the node which we can use to call to update the node data if we need to , // this is done by sync tree, we don't want to add a $watch for each node as that would be crazy insane slow // so we have to do this diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.controller.js index 2a6e822a22..791761f1aa 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.controller.js @@ -45,38 +45,24 @@ angular.module("umbraco").controller("Umbraco.Dialogs.LinkPickerController", args.event.stopPropagation(); eventsService.emit("dialogs.linkPicker.select", args); + + if ($scope.currentNode) { + //un-select if there's a current one selected + $scope.currentNode.selected = false; + } - var c = $(args.event.target.parentElement); + $scope.currentNode = args.node; + $scope.currentNode.selected = true; + $scope.target.id = args.node.id; + $scope.target.name = args.node.name; - //renewing - if (args.node !== $scope.target) { - if ($scope.selectedEl) { - $scope.selectedEl.find(".temporary").remove(); - $scope.selectedEl.find("i.umb-tree-icon").show(); - } - - $scope.selectedEl = c; - $scope.target.id = args.node.id; - $scope.target.name = args.node.name; - - $scope.selectedEl.find("i.umb-tree-icon") - .hide() - .after(""); - - if (args.node.id < 0) { - $scope.target.url = "/"; - } else { - contentResource.getNiceUrl(args.node.id).then(function (url) { - $scope.target.url = url; - }); - } - } else { - $scope.target = undefined; - //resetting - if ($scope.selectedEl) { - $scope.selectedEl.find(".temporary").remove(); - $scope.selectedEl.find("i.umb-tree-icon").show(); - } + if (args.node.id < 0) { + $scope.target.url = "/"; + } + else { + contentResource.getNiceUrl(args.node.id).then(function (url) { + $scope.target.url = url; + }); } if (!angular.isUndefined($scope.target.isMedia)) { diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.html index a6167d56eb..a567e616f3 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.html @@ -31,12 +31,13 @@ - - + +