diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/_obsolete/umbItemSorter.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/_obsolete/umbItemSorter.directive.js deleted file mode 100644 index 30a01e43c1..0000000000 --- a/src/Umbraco.Web.UI.Client/src/common/directives/_obsolete/umbItemSorter.directive.js +++ /dev/null @@ -1,69 +0,0 @@ -/** -* @ngdoc directive -* @name umbraco.directives.directive:umbItemSorter -* @deprecated -* We plan to remove this directive in the next major version of umbraco (8.0). The directive is not recommended to use. -* @function -* @element ANY -* @restrict E -* @description A re-usable directive for sorting items -**/ - -function umbItemSorter(angularHelper) { - return { - scope: { - model: "=" - }, - restrict: "E", // restrict to an element - replace: true, // replace the html element with the template - templateUrl: 'views/directives/_obsolete/umb-item-sorter.html', - link: function(scope, element, attrs, ctrl) { - var defaultModel = { - okButton: "Ok", - successMsg: "Sorting successful", - complete: false - }; - //assign user vals to default - angular.extend(defaultModel, scope.model); - //re-assign merged to user - scope.model = defaultModel; - - scope.performSort = function() { - scope.$emit("umbItemSorter.sorting", { - sortedItems: scope.model.itemsToSort - }); - }; - - scope.handleCancel = function () { - scope.$emit("umbItemSorter.cancel"); - }; - - scope.handleOk = function() { - scope.$emit("umbItemSorter.ok"); - }; - - //defines the options for the jquery sortable - scope.sortableOptions = { - axis: 'y', - cursor: "move", - placeholder: "ui-sortable-placeholder", - update: function (ev, ui) { - //highlight the item when the position is changed - $(ui.item).effect("highlight", { color: "#049cdb" }, 500); - }, - stop: function (ev, ui) { - //the ui-sortable directive already ensures that our list is re-sorted, so now we just - // need to update the sortOrder to the index of each item - angularHelper.safeApply(scope, function () { - angular.forEach(scope.itemsToSort, function (val, index) { - val.sortOrder = index + 1; - }); - - }); - } - }; - } - }; -} - -angular.module('umbraco.directives').directive("umbItemSorter", umbItemSorter); diff --git a/src/Umbraco.Web.UI.Client/src/views/directives/_obsolete/umb-item-sorter.html b/src/Umbraco.Web.UI.Client/src/views/directives/_obsolete/umb-item-sorter.html deleted file mode 100644 index 569a678dfb..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/directives/_obsolete/umb-item-sorter.html +++ /dev/null @@ -1,38 +0,0 @@ -
- -
-
-

Sort children of {{viewModel.name}}

- - - - - - - - - - - - - - - -
NameLast UpdateIndex
{{item.column1}}{{item.column2}}{{item.column3}}
- -
-
- - -
-
-
-
- {{model.successMsg}} -
- -
- -
-
-