diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js index da04104185..89c8b541d1 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js @@ -4,7 +4,7 @@ function ContentEditController($rootScope, $scope, $routeParams, $q, $window, appState, contentResource, entityResource, navigationService, notificationsService, serverValidationManager, contentEditingHelper, treeService, formHelper, umbRequestHelper, - editorState, $http, eventsService, relationResource, overlayService, angularHelper) { + editorState, $http, eventsService, relationResource, overlayService) { var evts = []; var infiniteMode = $scope.infiniteModel && $scope.infiniteModel.infiniteMode; @@ -309,7 +309,7 @@ } function ensureDirtyIsSetIfAnyVariantIsDirty() { - + $scope.contentForm.$dirty = false; for (var i = 0; i < $scope.content.variants.length; i++) { diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/grid/grid.rte.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/grid/grid.rte.directive.js index 0dddada8ad..372fb472fa 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/grid/grid.rte.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/grid/grid.rte.directive.js @@ -55,7 +55,7 @@ angular.module("umbraco.directives") //initialize the standard editor functionality for Umbraco tinyMceService.initializeEditor({ editor: editor, - value: scope.value, + model: scope, currentForm: angularHelper.getCurrentForm(scope) }); @@ -67,7 +67,7 @@ angular.module("umbraco.directives") $timeout(function () { if (scope.value === null) { - editor.trigger("focus"); + editor.focus(); } }, 400); diff --git a/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js b/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js index f6c2e93182..3fc11f8225 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js @@ -1194,7 +1194,7 @@ function tinyMceService($rootScope, $q, imageHelper, $locale, $http, $timeout, s .css("top", "auto") .css("margin-top", "0") .css("width", tinyMceWidth); - } + } }, @@ -1214,15 +1214,15 @@ function tinyMceService($rootScope, $q, imageHelper, $locale, $http, $timeout, s if (!args.editor) { throw "args.editor is required"; } - //if (!args.value) { - // throw "args.value is required"; + //if (!args.model.value) { + // throw "args.model.value is required"; //} var unwatch = null; //Starts a watch on the model value so that we can update TinyMCE if the model changes behind the scenes or from the server function startWatch() { - unwatch = $rootScope.$watch(() => args.value, function (newVal, oldVal) { + unwatch = $rootScope.$watch(() => args.model.value, function (newVal, oldVal) { if (newVal !== oldVal) { //update the display val again if it has changed from the server; //uses an empty string in the editor when the value is null @@ -1247,7 +1247,7 @@ function tinyMceService($rootScope, $q, imageHelper, $locale, $http, $timeout, s //stop watching before we update the value stopWatch(); angularHelper.safeApply($rootScope, function () { - args.value = args.editor.getContent(); + args.model.value = args.editor.getContent(); }); //re-watch the value startWatch(); @@ -1255,8 +1255,8 @@ function tinyMceService($rootScope, $q, imageHelper, $locale, $http, $timeout, s args.editor.on('init', function (e) { - if (args.value) { - args.editor.setContent(args.value); + if (args.model.value) { + args.editor.setContent(args.model.value); } //enable browser based spell checking args.editor.getBody().setAttribute('spellcheck', true); diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js index a0cae4923b..2181361470 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js @@ -45,12 +45,7 @@ angular.module("umbraco") //create a baseline Config to exten upon var baseLineConfigObj = { - maxImageSize: editorConfig.maxImageSize, - init_instance_callback: function (editor) { - editor.on('Change', function (e) { - $scope.model.value = editor.getContent(); - }); - } + maxImageSize: editorConfig.maxImageSize }; angular.extend(baseLineConfigObj, standardConfig); @@ -63,7 +58,7 @@ angular.module("umbraco") //initialize the standard editor functionality for Umbraco tinyMceService.initializeEditor({ editor: editor, - value: $scope.model.value, + model: $scope.model, currentForm: angularHelper.getCurrentForm($scope) });