Open GoogleCodeExporter opened 9 years ago
Any news regarding this issue?
Original comment by seba.d...@gmail.com
on 17 Aug 2012 at 12:02
Need suggestion for the above mentioned issue
Original comment by rev...@gmail.com
on 23 Aug 2012 at 4:05
2016 and having same issue. I wish to make jwysiwyg optional for the user so I am using a button to create & destroy it. After destroy, it disappears from the DOM (header and iframe no longer visible in Safari DOM inspector) but now clicking on the underlying textarea triggers a JS error as described above. Error does not occur until after the jwysiwyg instance has been created and destroyed once.
I think I have fixed the problem though not being an expert as JS, I am not 100% sure how safe it is but the js error is cause by the following line in query.wysiwyg.js (line 1063 in my version)
self.editor.get(0).contentWindow.focus();
By debugging in Safari to inspect self.editor when the editor was active and after it had been destroyed, I found that the editor object still existed but by comparing it's attributes before and after destruction, I was able to confirm that the contentWindow attribute was normally set to "Window" but was null after the editor was destroyed so I added an IF statement that identified whether the editor had been destroyed. Changing the above line to the following solves the problem and I double checked to ensure that the focus() method was still executing when the editor instance was active,
if (self.editor.get(0).contentWindow) self.editor.get(0).contentWindow.focus();
Hope this helps someone else.
Original issue reported on code.google.com by
rider.sa...@gmail.com
on 31 Jan 2012 at 3:24