Announcement

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

#1 2007-07-07 02:55:51

chriska
New member
Registered: 2007-04-09
Posts: 7

xinha problem with wrong width

Wow, what a frustrating night. At first xinha was so easy to setup! There were little problems. One of them was, that the window wouldn't react to changing the width-option.

        xinha_config = new Xinha.Config();
        xinha_config.width  = '333';
        xinha_config.height  = '394';

I've been checking DOM-Model-Values the whole night. The DIV around the TABLE class=htmlarea is controlled by my own css. The Table reacts well to changing the width-option. But it does not take the intended width because there is a DIV class=dialog and an IFRAME class=xinhaiframe inside which are larger than my width option value and which do not react to the width-option.

So I was digging through all the source code:

xinha_config.width becomes _a3, Everything is fine
_a3 becomes _a5, ok

Then we have the line
_a5=this._htmlArea.offsetWidth;
which overwrites my width-value before
_a5 becomes _b2 (b2 controls the IFRAME width)

DIV class=dialog doesn't seem to be controlled by width-option at all. It is set in inline-dialog.js:
this.rootElem.style.width=this.width=this.editor._framework.ed_cell.offsetWidth+"px";
the value is then changed several times within this file.

I understand the offsetWidth attribute is used in order to resize the editor, but I do not need this feature. I just need xinha to have exactly the width i specify in the width-option. 2 things that could be done:

1. Resize-Option. Give users the possibility to switch off all the resizing functionality.
2. The offsetWidth should only check on the first Parent of the xinha-Table. I do not have a clue where its looking up its values now!

I'm very unhappy I cannot use xinha on this project :-(

Offline

#2 2007-07-07 04:59:52

chriska
New member
Registered: 2007-04-09
Posts: 7

Re: xinha problem with wrong width

Oh, problem is in Firefox 2.0.0.4., it partly falls out of the DIV
In IE7 the Editor is also too wide, but IE extends the width of the DIV to the size of the editor
Xinha version is:
Release: 0.931 (2007-05-16)
Head: http://svn.xinha.python-hosting.com/trunk/XinhaCore.js
Revision: 819
Last Changed By: ray

I cannot link to the page, because the server is running in an intranet.

Offline

#3 2007-07-07 10:28:49

wymsy
Xinha Community Member
From: Massachusetts, USA
Registered: 2005-04-01
Posts: 44
Website

Re: xinha problem with wrong width

Try

xinha_config = new Xinha.Config();
xinha_config.width  = '333px';
xinha_config.height  = '394px';

FF is fussy about units.

Offline

#4 2007-07-10 11:18:13

geeksquared
New member
Registered: 2007-07-10
Posts: 1

Re: xinha problem with wrong width

I am having an issue where the Xinha area will not shink below approx 300px but will increase to any specified width.

I have taken all but two of the buttons out of the tool bar just incase these were pushing it out.

I've tried both
         xinha_config.width  = '210px';
and
         xinha_editors[thisEditor].config.width = '210px';

any help would be appreciated before all hair is pulled out.

Offline

#5 2007-07-15 20:45:17

chriska
New member
Registered: 2007-04-09
Posts: 7

Re: xinha problem with wrong width

Unfortunately adding px does not help. The value is overwritten by the xinha resize function  (offsetWidth). Unfortunately this function does not work with my boxes (divs). As I wrote, I have spent hours looking through the xinha source and the problem is that xinha does not receive the correct offsetWidth from firefox.

Offline

#6 2007-11-17 22:05:55

chriska
New member
Registered: 2007-04-09
Posts: 7

Re: xinha problem with wrong width

I'm still stuck with this problem. Xinha does not keep to the width I specified in the config file. It is a bug in the xinha source code.

My Config (I also tried without the px, same result):
        xinha_config = new Xinha.Config();
        xinha_config.width  = '333px';
        xinha_config.height  = '391px';



Imagine my DOM (Pseudo-Code):

<DIV width=604>
  <TABLE width=333> as specified :-)
    <TBODY>
      <TR>
        <TD>
          <DIV toolbar>
      <TR>
        <TD panels top>
      <TR>
        <TD panels left>
        <TD>
          <DIV dialog width=706> :-( not as specified! it shouldn't be bigger than the TABLE
          <IFRAME xinha_iframe width=706> :-((( The xinha Textarea is bigger than the surrounding DIV. Looks super-ugly!
          <TEXTAREA xinha_article width=706
        <TD panels right>
...

That's what it looks like. Can anyone help?

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx  DIV is 604
x                                                                 x
x  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx XINHA is 706, should be whatever I config it to be e.g. 333
x  x                                                                           x
x  x                                                                           x
x  x                                                                           x
x  x                                                                           x
x  x                                                                           x
x  x                                                                           x
x  x                                                                           x
x  x                                                                           x
x  x                                                                           x
x  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
x                                                                 x
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx


Now if I change my Config to:

        xinha_config = new Xinha.Config();
        xinha_config.width  = '580px';
        xinha_config.height  = '391px';

it still looks like this:

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx  DIV is 604
x                                                                 x
x  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx XINHA is 706, it doesn't care what I specify in the config file
x  x                                                                           x
x  x                                                                           x
x  x                                                                           x
x  x                                                                           x
x  x                                                                           x
x  x                                                                           x
x  x                                                                           x
x  x                                                                           x
x  x                                                                           x
x  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
x                                                                 x
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Last edited by chriska (2007-11-17 22:16:42)

Offline

#7 2007-11-18 18:49:01

ray
Xinha Administrator
From: Germany
Registered: 2005-03-23
Posts: 521
Website

Re: xinha problem with wrong width

Do you use a custom toolbar, and may be you have neither "separator" nor "linebreak" tags in it. That causes the toolbar to be one line that causes the table to grow to the length of the toolbar cell. If this is not the case, could you provide a link to a page where one can have a look at the problem? I'd like to help to sort this out, but I cannot reproduce it.

Offline

Board footer

Powered by FluxBB