You are not logged in.
Hi,
I am trying to setup xinha and I'm having a problem selecting the editor when there is no content in it. If there is content in the text area then I can select the editor fine but when it is empty the only way I have found to select the editor is to resize the window, then it works as I would expect.
Any suggestions
Offline
I have found a temporary work around by calling
setTimeout(function() { xinha_editors['myeditor'].sizeEditor(); }, 5000);
after the HTMLArea.startEditors command.
It's a bit of a hack though and would like a more elegant solution.
Offline
OK, found the real problem.
If an editor was hidden (in this case it was in display:none div) then the height and width would always be set to zero in the sizeEditor function so clicking would not trigger the onClick event.
Below is a simple patch defaulting to the values in the config if height or width is zero - works on my setup but probably needs some testing by people who know the system better.
Index: C:/dev/xinha/trunk/htmlarea.js
===================================================================
--- C:/dev/xinha/trunk/htmlarea.js (revision 515)
+++ C:/dev/xinha/trunk/htmlarea.js (working copy)
@@ -1804,6 +1804,10 @@
// now we size the INNER area and position stuff in the right places.
width = this._htmlArea.offsetWidth;
height = this._htmlArea.offsetHeight;
+
+ //if height or width is zero then default to config, otherwise it is impossible to select editor
+ if (width == 0) width = this.config.width;
+ if (height == 0) height = this.config.height;
// Set colspan for toolbar, and statusbar, rowspan for left & right panels, and insert panels to be displayed
// into thier rows
Offline