* Adds TinyMCE JS assets into init page load via script in default.cshtml view for Umbraco backoffice ng-app

* Add TinyMCE JS assets array via NG app.value & uses assetsService to load (if not loaded in time by main init script above)
This commit is contained in:
Warren Buckley
2019-08-19 14:36:56 +01:00
parent e4f19f7192
commit b9b4721295
9 changed files with 113 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
angular.module("umbraco")
.controller("Umbraco.PropertyEditors.RTEController",
function ($scope, $q, assetsService, $timeout, tinyMceService, angularHelper) {
function ($scope, $q, assetsService, $timeout, tinyMceService, angularHelper, tinyMceAssets) {
// TODO: A lot of the code below should be shared between the grid rte and the normal rte
@@ -30,9 +30,9 @@ angular.module("umbraco")
var promises = [];
//queue file loading
if (typeof tinymce === "undefined") { // Don't reload tinymce if already loaded
promises.push(assetsService.loadJs("lib/tinymce/tinymce.min.js", $scope));
}
tinyMceAssets.forEach(function (tinyJsAsset) {
promises.push(assetsService.loadJs(tinyJsAsset, $scope));
});
//stores a reference to the editor
var tinyMceEditor = null;