Closed ngavard closed 6 years ago
@ngavard I am now doing something like this:
$scope.tinymceOptions = {
setup: function(editor) {
// only focus event worked in my app :-(
editor.on('focus', function(event) {
var editor = event.target;
if (editor.readonly === true) {
event.target.setMode('readonly');
}
})
}
}
Not sure if there is a better way.
Thanks! @varmanishant
setMode('readonly') works for me.
Hi ui-tinymce team,
I tried to use
myCtrl.tinyMceOptions = { inline : true, plugins : " code fullscreen paste lists advlist table emoticons textcolor hr", menubar: false, toolbar : 'bold [...] ', readonly : myCtrl.readonly //set readonly } ;
and
<div ui-tinymce="myCtrl.tinyMceOptions" ng-model="ctrl.content" ></div>
But when myCtrl.readonly is updated, tinymce is not refreshed.
I tried
$scope.$watch("myCtrl.readonly", function(readonly, oldVal){ $scope.$broadcast('$tinymce:refresh'); });
I see Tinymce refreshed but not in readonly. I tried the ng-readonly directive in the div without success.I saw that there is an issue with ng-disabled currently open. I wonder if there is a chance that ng-readonly could be handled the same way as ng-disabled ?