Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Summernote WYSIWYG : set code view as default view

I can't find anything about this on the web. Is there a way to set the default view of Summernote (WYSIWYG jQuery text editor) to be the code/html view. I want to see directly the HTML code when landing on the form page.

Thank you

like image 917
mentinet Avatar asked Jan 29 '26 16:01

mentinet


1 Answers

You can simulate a click on the codeview button (after summernote initialization), it works for me :

$('.summernote').summernote({
     oninit: function() {
         $("div.note-editor button[data-event='codeview']").click();
     }
});
like image 149
Simon Avatar answered Jan 31 '26 20:01

Simon



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!