Hi Dalmazio,

I've commited all your fixes. Thanks!

cheers,
   Alex

Dalmazio Brisinda wrote:
> Hi Alex,
> 
> I've made improved bug fixes to the qx.ui.embed.Gallery source since the
> last go, that will allow the loadComplete to fire more reliably.
> Specifically, with the previous bug fix, it still doesn't work when
> appending a list of images to the existing list via addFromPartialList() or
> addFromUpdatedList(). So the new and improved bug fix involves undoing the
> previous bug fix (i.e., undoing modifications to the _processedImages
> instance variable in the removeAll() and deleteByPosition() member
> functions) and doing the following instead:
> 
> 1. Change the following:
> 
>     addFromPartialList : function(vPartialList)
>     {            
>       for (var i=0, a=vPartialList, l=a.length; i<l; i++) {
>         this._list.push(a[i]);  // added by dalmazio
>         this._frame.appendChild(this.createCell(a[i], i));
>       }
>     },
> 
> to:
> 
>     addFromPartialList : function(vPartialList)
>     {      
>       this._listSize = this._list.length + vPartialList.length;
>       
>       for (var i=0, a=vPartialList, l=a.length; i<l; i++) {
>         this._list.push(a[i]);  // added by dalmazio
>         this._frame.appendChild(this.createCell(a[i], i));
>       }
>     },
> 
> 2. Change the following:
> 
>     addFromUpdatedList : function(vNewList)
>     {
>       for (var a=vNewList, l=a.length, i=this._list.length; i<l; i++) {
>         this._frame.appendChild(this.createCell(a[i], i));
>       }
> 
>       this._list = vNewList;
>     },
> 
> to
> 
>     addFromUpdatedList : function(vNewList)
>     {
>       this._listSize = vNewList.length;
>     
>       for (var a=vNewList, l=a.length, i=this._list.length; i<l; i++) {
>         this._frame.appendChild(this.createCell(a[i], i));
>       }
> 
>       this._list = vNewList;
>     },
> 
> 3. Make imageOnComplete() look like this (i.e., how it looked originally
> before any mods):
> 
>     imageOnComplete : function()
>     {
>       this._processedImages++;
>       
>       if (this._processedImages == this._listSize) {       
>         this.dispatchEvent(new qx.event.type.Event("loadComplete"), true);
>       }
>     },
> 
> We use the _listSize instance variable in imageOnComplete() afterall since
> it refers to the full combined image list size once all images have been
> appended to the current list -- provided it is kept up to date by the
> modifications in 1 & 2. If we do this we don't need to update the
> _processedImages instance variable in any of the remove/delete methods --
> these methods can stay as they originally were (i.e., removeAll() and
> deleteByPosition() can be left as they were prior to any mods).
> 
> I think this should be it.
> 
> (Famous last words...)
> 
> Best,
> Dalmazio

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to