add readonly mode for rich text editor property editor

This commit is contained in:
Mads Rasmussen
2022-05-04 12:38:27 +02:00
parent 382d91c461
commit a9c6d98c85
2 changed files with 6 additions and 1 deletions

View File

@@ -1441,7 +1441,8 @@ function tinyMceService($rootScope, $q, imageHelper, $locale, $http, $timeout, s
// Then we need to add an event listener to the editor
// That will update native browser drag & drop events
// To update the icon to show you can NOT drop something into the editor
var toolbarItems = args.editor.settings.toolbar.split(" ");
var toolbarItems = args.editor.settings.toolbar === false ? [] : args.editor.settings.toolbar.split(" ");
if(isMediaPickerEnabled(toolbarItems) === false){
// Wire up the event listener
args.editor.on('dragend dragover draggesture dragdrop drop drag', function (e) {

View File

@@ -89,6 +89,10 @@ angular.module("umbraco")
Utilities.extend(baseLineConfigObj, standardConfig);
// Readonly mode
baseLineConfigObj.toolbar = $scope.readonly ? false : baseLineConfigObj.toolbar;
baseLineConfigObj.readonly = $scope.readonly ? 1 : baseLineConfigObj.readonly;
// We need to wait for DOM to have rendered before we can find the element by ID.
$timeout(function () {
tinymce.init(baseLineConfigObj);