diff --git a/src/Umbraco.Web.UI.Client/src/views/stylesheets/delete.controller.js b/src/Umbraco.Web.UI.Client/src/views/stylesheets/delete.controller.js new file mode 100644 index 0000000000..cdfe92d105 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/views/stylesheets/delete.controller.js @@ -0,0 +1,29 @@ +/** + * @ngdoc controller + * @name Umbraco.Editors.StyleSheets.DeleteController + * @function + * + * @description + * The controller for deleting stylesheets + */ +function StyleSheetsDeleteController($scope, codefileResource, treeService, navigationService) { + + $scope.performDelete = function() { + + //mark it for deletion (used in the UI) + $scope.currentNode.loading = true; + + codefileResource.deleteByPath('stylesheets', $scope.currentNode.id) + .then(function() { + $scope.currentNode.loading = false; + treeService.removeNode($scope.currentNode); + navigationService.hideMenu(); + }); + }; + + $scope.cancel = function() { + navigationService.hideDialog(); + }; +} + +angular.module("umbraco").controller("Umbraco.Editors.StyleSheets.DeleteController", StyleSheetsDeleteController); diff --git a/src/Umbraco.Web.UI.Client/src/views/stylesheets/delete.html b/src/Umbraco.Web.UI.Client/src/views/stylesheets/delete.html new file mode 100644 index 0000000000..fd6f6edd78 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/views/stylesheets/delete.html @@ -0,0 +1,12 @@ +
+