From 5ff329778d352e702d874c5653cfe0120def2fa2 Mon Sep 17 00:00:00 2001 From: deepak4u Date: Thu, 29 Oct 2015 15:53:11 +0000 Subject: [PATCH] fix for issue u4-6515 --- .../propertyeditors/contentpicker/contentpicker.controller.js | 4 +++- .../propertyeditors/mediapicker/mediapicker.controller.js | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js index 48f4ed5bda..c201ea34f0 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js @@ -1,7 +1,7 @@ //this controller simply tells the dialogs service to open a mediaPicker window //with a specified callback, this callback will receive an object with a selection on it -function contentPickerController($scope, dialogService, entityResource, editorState, $log, iconHelper, $routeParams, fileManager, contentEditingHelper) { +function contentPickerController($scope, dialogService, entityResource, editorState, $log, iconHelper, $routeParams, fileManager, contentEditingHelper, angularHelper) { function trim(str, chr) { var rgxtrim = (!chr) ? new RegExp('^\\s+|\\s+$', 'g') : new RegExp('^' + chr + '+|' + chr + '+$', 'g'); @@ -87,6 +87,7 @@ function contentPickerController($scope, dialogService, entityResource, editorSt $scope.clear(); $scope.add(data); } + angularHelper.getCurrentForm($scope).$setDirty(); }, treeAlias: $scope.model.config.startNode.type, section: $scope.model.config.startNode.type @@ -141,6 +142,7 @@ function contentPickerController($scope, dialogService, entityResource, editorSt $scope.remove = function (index) { $scope.renderModel.splice(index, 1); + angularHelper.getCurrentForm($scope).$setDirty(); }; $scope.add = function (item) { diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/mediapicker/mediapicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/mediapicker/mediapicker.controller.js index d2342ec5bc..245b0e055b 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/mediapicker/mediapicker.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/mediapicker/mediapicker.controller.js @@ -1,7 +1,7 @@ //this controller simply tells the dialogs service to open a mediaPicker window //with a specified callback, this callback will receive an object with a selection on it angular.module('umbraco').controller("Umbraco.PropertyEditors.MediaPickerController", - function ($rootScope, $scope, dialogService, entityResource, mediaResource, mediaHelper, $timeout, userService) { + function ($rootScope, $scope, dialogService, entityResource, mediaResource, mediaHelper, $timeout, userService, angularHelper) { //check the pre-values for multi-picker var multiPicker = $scope.model.config.multiPicker && $scope.model.config.multiPicker !== '0' ? true : false; @@ -54,6 +54,7 @@ angular.module('umbraco').controller("Umbraco.PropertyEditors.MediaPickerControl $scope.remove = function(index) { $scope.images.splice(index, 1); $scope.ids.splice(index, 1); + angularHelper.getCurrentForm($scope).$setDirty(); $scope.sync(); }; @@ -76,6 +77,7 @@ angular.module('umbraco').controller("Umbraco.PropertyEditors.MediaPickerControl $scope.images.push(media); $scope.ids.push(media.id); + angularHelper.getCurrentForm($scope).$setDirty(); }); $scope.sync();