taoguan / jwysiwyg

Automatically exported from code.google.com/p/jwysiwyg
0 stars 0 forks source link

cannot set readonly #151

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. tried $('#ed').replaceWith($(#ed').wysiwyg('getContent'));

What is the expected output? What do you see instead?
expected editor turn readonly, but it is still editable and all buttons 
still functioning.

What version of the product are you using? On what operating system?
latest, win 7 ie 8

Please provide any additional information below.
is it possible to have a way of dynamically control the readonly using 
javascript?

Original issue reported on code.google.com by wpan...@gmail.com on 11 Jan 2010 at 1:33

GoogleCodeExporter commented 8 years ago
Are You sure that Your editor has "ed" identifier?

Original comment by akzhan.a...@gmail.com on 18 Jan 2010 at 11:20

GoogleCodeExporter commented 8 years ago
I have the same issue, I set the textarea as readonly="readonly" and 
disabled="yes";
and also by jquery set the attribute as $('#editor').wysiwyg().attr("disabled",
"disabled"); and still can edit it.. 

Original comment by brede%br...@gtempaccount.com on 11 Apr 2010 at 3:51

GoogleCodeExporter commented 8 years ago
My work around for this was to create a readOnlyHandler function, which is 
essentially a key listener that calls event.preventDefault(); and returns 
false, and when I wanted to set it into read only mode I apply the function to 
the editorDoc body.

For posterity, I also iterate through all LIs in the toolbar and add the 
disabled class.

Original comment by nathanan...@gmail.com on 27 Feb 2013 at 2:36