Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2006-05-24 21:24:10

sinuousj
New member
From: New Zealand
Registered: 2006-05-24
Posts: 3
Website

Problem selecting xinha editor when empty

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

#2 2006-05-24 22:19:51

sinuousj
New member
From: New Zealand
Registered: 2006-05-24
Posts: 3
Website

Re: Problem selecting xinha editor when empty

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

#3 2006-05-25 00:04:56

sinuousj
New member
From: New Zealand
Registered: 2006-05-24
Posts: 3
Website

Re: Problem selecting xinha editor when empty

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

Board footer

Powered by FluxBB