Open loykianos opened 9 years ago
Now, it isn't supported. I will consider it.
+1
Any updates please
+1 would be great. Reduces a lot of boilerplate is my existing code.
+1 please.
+1 please
+1
Any news on this? Or can anyone give me some pointers on how this could be implemented? The original version has this in built in to the Basic API using $('#summernote').summernote('disable');
and $('#summernote').summernote('enable');
Thanks
@nicolaib instead, you can show an absolute div
with z-index
greater than parent. So that it acts as overlay and stops interaction to summernote. Some CSS can do this job easily ;)
I solved it this way, which removes the possibility to change the text and images. It's also kinda hacky but better than putting a div
over the textarea - I think ;-)
$timeout(function(){
angular.element('.note-editable').attr('contenteditable', false);
angular.element('.note-control-selection').remove();
},0);
This is useful if it's needed on-the-fly.
Another solution that is also useful (and maybe better if not needed on-the-fly) is to show the editor content as trusted HTML like this:
Controller:
function trustedHTML(inputHTML){
return $sce.trustAsHtml(inputHTML);
}
View:
<div ng-bind-html="$ctrl.trustedHTML($ctrl.text)"></div>
@nicolaib 👍
Waiting for this 👍
+1
You can also disable it by accessing the underlying summernote element:
$scope.init = function() {
$timeout(function() {
$scope.editor.summernote('disable');
}, 0);
});
<summernote on-init="init()" editor="editor" ... ></summernote>
Any updates on this?
Any solution here ????
Hi there, is there a way to disable the summernote? I have tried using ng-disabled but it doesn't seem to work. Good job either way.