less flickering on init of TinyMCE

This commit is contained in:
Niels Lyngsø
2019-09-20 11:08:21 +02:00
parent 12fd9baf3b
commit 4259c9bf1d
3 changed files with 20 additions and 17 deletions

View File

@@ -9,12 +9,20 @@
.umb-rte .mce-tinymce {
box-shadow: none;
}
.umb-rte .umb-rte-editor{
.umb-rte .umb-rte-editor-con {
height: 24px;
visibility: hidden;
}
.umb-rte .umb-rte-editor {
min-height: 100px;
}
.umb-rte.--initialized .umb-rte-editor-con {
height:auto;
min-height: 100px;
visibility: visible;
}
.umb-rte .mce-content-body {
background-color: @white;

View File

@@ -45,7 +45,7 @@ angular.module("umbraco")
toolbar: editorConfig.toolbar,
mode: editorConfig.mode
}));
//wait for queue to end
$q.all(promises).then(function (result) {
@@ -61,23 +61,16 @@ angular.module("umbraco")
width: width,
height: height
};
angular.extend(baseLineConfigObj, standardConfig);
baseLineConfigObj.setup = function (editor) {
//set the reference
tinyMceEditor = editor;
//$scope.isLoading = false;
tinyMceEditor.on('init', function (e) {
$timeout(function () {
console.log(editor);
//editor.editorContainer.style.display = 'block'
//editorNode.style.display = 'block'
$scope.isLoading = false;
}, 1000)
});
});
//initialize the standard editor functionality for Umbraco
@@ -86,9 +79,10 @@ angular.module("umbraco")
model: $scope.model,
currentForm: angularHelper.getCurrentForm($scope)
});
};
angular.extend(baseLineConfigObj, standardConfig);
/** Loads in the editor */
tinymce.init(baseLineConfigObj);

View File

@@ -1,6 +1,7 @@
<div ng-controller="Umbraco.PropertyEditors.RTEController" class="umb-property-editor umb-rte">
<div ng-controller="Umbraco.PropertyEditors.RTEController" class="umb-property-editor umb-rte" ng-class="{'--initialized': !isLoading}">
<umb-load-indicator ng-if="isLoading"></umb-load-indicator>
<div ng-style="{ visibility : isLoading ? 'hidden' : 'visible', width :containerWidth, height: containerHeight, overflow: containerOverflow}"
id="{{textAreaHtmlId}}" class="umb-rte-editor"></div>
<div class="umb-rte-editor-con">
<div class="umb-rte-editor"></div>
</div>
</div>