Finaly i adopted another solution, seem's to work like a charm.
Each time a Label value is updated, i fetch every images using
getElementsByTagName in the domElement of the Label.
foreach image, :
* setAttribute "previousSrc" with actuel src
* change src with a blank image
* set an onload event launching function named "imageOnLoad",
* remove height/width attribute,
* change src with the original one
In the function "imageOnLoad",
* the parentNode of the image (so the div containing the Label) to "auto".
* fetch offsetHeight of this same div, computed by the browser.
* finaly, set the height of the label with this offset using setHeight.
Cheers
In think this poorly hack can be used on embed.Html too.
On Sun, Oct 16, 2011 at 11:32 AM, franck34 <franck....@gmail.com> wrote:
>
> Hi all !
>
> Got a window, containing an horizontal spliter.
>
> In the left part of this horizontal splitter, i got a composite box having
> VBox layout.
> In this composite box, i got a flow of Label with rich:true.
> In the html content of theses label, i have some images time to time (it's
> a "realtime" forum).
> Theses Label are dynamicaly filled.
>
> Problem:
> * the Label compute his height, no problem when there is no images
> * when there is images, the Label compute his height but before images are
> completely loaded. Notice images don't have "height" attributes (dynamicaly
> resized server side).
> * so Label having some images got a height which don't really mach the real
> content, i.e when images are fully loaded, Label content is cropped in this
> case.
> * i'm looking to fire the good event to recompute everything Label height
> and adjust them
>
> The poor solution i've found :
> * When all Label are loaded, i setTimeout a function which resize the
> window (width+1), and then another one which resize the window (width-1) few
> millisecond later.
> * This solution is working, Label height are correct after window has been
> resized.
> * i know it will not work if the setTimeout is fired before every images
> contained in Labels are not fully loaded, but i don't see any other way at
> the moment.
>
> The better solution :
> * when generating rich Label, see if there is images inside, and then add
> onload event on every image, map them, and resize the window when all images
> are fully loaded
>
>
> Question:
> Right now, i'm resizing the window, which bubble resize of all childs. Do
> you know the event name, or the function, which is responsable to adjust
> width/height of every childs of a widget ?
>
>
>
> Thanks in advance
>
> Franck
>
>
>
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel