From a384c0866bd74c2f8488fc8ca447a2b283b1d712 Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 18 Sep 2019 20:37:05 +1000 Subject: [PATCH] Ensures the tinymce baseURL is set before it's initialized so that when we minify it's assets it knows where to load more assets from. --- .../common/directives/components/grid/grid.rte.directive.js | 1 - .../src/common/services/tinymce.service.js | 4 ++++ .../src/views/propertyeditors/rte/rte.controller.js | 3 +-- 3 files changed, 5 insertions(+), 3 deletions(-) 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 af82199d55..f606c0539a 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 @@ -144,7 +144,6 @@ angular.module("umbraco.directives") //we need to add a timeout here, to force a redraw so TinyMCE can find //the elements needed $timeout(function () { - tinymce.DOM.events.domLoaded = true; tinymce.init(baseLineConfigObj); }, 150, false); } 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 8f37f872b1..6b1e6fa853 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 @@ -242,6 +242,10 @@ function tinyMceService($rootScope, $q, imageHelper, $locale, $http, $timeout, s */ getTinyMceEditorConfig: function (args) { + //global defaults, called before/during init + tinymce.DOM.events.domLoaded = true; + tinymce.baseURL = Umbraco.Sys.ServerVariables.umbracoSettings.umbracoPath + "/lib/tinymce/"; // trailing slash important + var promises = [ this.configuration(), getStyles(args.stylesheets) 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 48170fb4b7..16fa79f667 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 @@ -84,8 +84,7 @@ angular.module("umbraco") //we need to add a timeout here, to force a redraw so TinyMCE can find //the elements needed - $timeout(function () { - tinymce.DOM.events.domLoaded = true; + $timeout(function () { tinymce.init(baseLineConfigObj); }, 200); }