Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

tinyMCE options

How can I toggle the readonly state in an initialized tinyMCE container?

Whilst the tinyMCE is initialised in a common javascript file, the option I want to change is specific to the logic of an individual page, and changes based on user's input via a checkbox.

This are some of the things I tried and all resulted in failure: http://pastebin.com/JEn2fyE6

like image 554
Alex Avatar asked Jan 17 '23 09:01

Alex


1 Answers

I just managed to do it this way:

Having the textarea set with id intro I do this

if($('.disabled_check').is(':checked')) {
    $('#intro_ifr').contents().find('body').attr('contenteditable', false);
}
like image 131
Alex Avatar answered Jan 19 '23 00:01

Alex