suyati / line-control

A Light Weight HTML5 Text Editor designed as a JQuery Plugin
Other
124 stars 90 forks source link

How I can disable editing #105

Open jaidpr opened 5 years ago

jaidpr commented 5 years ago

Can you please let me know if there is a setting to disable the complete control. I had tried with 'readonly':true, but not disabling the control.

pyhp2017 commented 3 years ago

it's simple, just add following code in the end of "editor.js". (after $.fn.editor function):

$.fn.disableEditor = function(){ $(this).data('editor').attr('contenteditable' , false); }

msnitish commented 3 years ago

it's simple, just add following code in the end of "editor.js". (after $.fn.editor function):

$.fn.disableEditor = function(){ $(this).data('editor').attr('contenteditable' , false); }

Similarly, if we want to check if the textvalue is empty, how do we write a function ? @pyhp2017 Thank You.