Reverting to use element ID to initialisation

This commit is contained in:
Niels Lyngsø
2019-09-24 17:10:20 +02:00
parent 6c0d06c77c
commit 493d7010ba
2 changed files with 8 additions and 5 deletions

View File

@@ -1,13 +1,16 @@
angular.module("umbraco")
.controller("Umbraco.PropertyEditors.RTEController",
function ($scope, $q, assetsService, $timeout, tinyMceService, angularHelper, tinyMceAssets, $element) {
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
$scope.isLoading = true;
var editorNode = $element[0].querySelector('.umb-rte-editor');
//To id the html textarea we need to use the datetime ticks because we can have multiple rte's per a single property alias
// because now we have to support having 2x (maybe more at some stage) content editors being displayed at once. This is because
// we have this mini content editor panel that can be launched with MNTP.
$scope.textAreaHtmlId = $scope.model.alias + "_" + String.CreateGuid();
var editorConfig = $scope.model.config ? $scope.model.config.editor : null;
if (!editorConfig || angular.isString(editorConfig)) {
editorConfig = tinyMceService.defaultPrevalues();
@@ -35,7 +38,7 @@ angular.module("umbraco")
var tinyMceEditor = null;
promises.push(tinyMceService.getTinyMceEditorConfig({
target: editorNode,
htmlId: $scope.textAreaHtmlId,
stylesheets: editorConfig.stylesheets,
toolbar: editorConfig.toolbar,
mode: editorConfig.mode

View File

@@ -2,6 +2,6 @@
<umb-load-indicator ng-if="isLoading"></umb-load-indicator>
<div class="umb-rte-editor-con">
<div class="umb-rte-editor" ng-style="{ width: containerWidth, height: containerHeight, overflow: containerOverflow}"></div>
<div id="{{textAreaHtmlId}}" class="umb-rte-editor" ng-style="{ width: containerWidth, height: containerHeight, overflow: containerOverflow}"></div>
</div>
</div>