Javascript
1 2 3 4 5 6 7 8 9 10 11 12 13 |
// TinyMce instance要全部Load完才能存取 $(window).load(function(){ if (site != 'global') { $('.translable.global').each(function(){ var $this = $(this); if($this.find('.mce-tinymce').length > 0){ var field_name = $this.data('name'); //tinymce.get(field_name).getBody().setAttribute('contenteditable', false); tinymce.get(field_name).setMode('readonly'); } }); } }); |
Reference:
- https://stackoverflow.com/questions/13881812/make-readonly-disable-tinymce-textarea