Opened 11 years ago

Closed 11 years ago

#7047 closed defect (fixed)

[patch] [cla] ImageGallery (ThumbinalPicker) bug on firefox 3

Reported by: guest Owned by: dante
Priority: high Milestone: 1.2
Component: DojoX Widgets Version: 1.1.1
Keywords: Image Gallery Thumbinal Cc:
Blocked By: Blocking:

Description

Image gallery don't work propely whit firefox 3..

The Tumhinbinal's imgContainer is not resized to img width...

I've developed a patch for this bug, see the line after "/* This is the patch: */":

dojo.extend(dojox.image.ThumbnailPicker? , {

_loadImage: function(data, index, callback){

var url = this.imageStore.getValue(data,this.imageThumbAttr); var img = document.createElement("img"); var imgContainer = document.createElement("div"); imgContainer.setAttribute("id","img_" + this.widgetid+"_"+index); imgContainer.appendChild(img); img._index = index; img._data = data;

this._thumbs[index] = imgContainer; var loadingDiv; if(this.useLoadNotifier){

loadingDiv = document.createElement("div"); loadingDiv.setAttribute("id","loadingDiv_" + this.widgetid+"_"+index);

If this widget was previously told that the main image for this thumb has been loaded, make the loading indicator transparent. this._setThumbClass(loadingDiv,

this._loadedImages[index] ? "thumbLoaded":"thumbNotifier");

imgContainer.appendChild(loadingDiv);

} var size = dojo.marginBox(this.thumbsNode); var defaultSize; var sizeParam; if(this.isHorizontal){

defaultSize = this.thumbWidth; sizeParam = 'w';

} else{

defaultSize = this.thumbHeight; sizeParam = 'h';

} size = size[sizeParam]; var sl = this.thumbScroller.scrollLeft, st = this.thumbScroller.scrollTop; dojo.style(this.thumbsNode, this._sizeProperty, (size + defaultSize + 20) + "px"); Remember the scroll values, as changing the size can alter them this.thumbScroller.scrollLeft = sl; this.thumbScroller.scrollTop = st; this.thumbsNode.appendChild(imgContainer);

dojo.connect(img, "onload", this, function(){

var realSize = dojo.marginBox(img)[sizeParam]; this._totalSize += (Number(realSize) + 4); dojo.style(this.thumbsNode, this._sizeProperty, this._totalSize + "px");

if(this.useLoadNotifier){dojo.style(loadingDiv, "width", (img.width - 4) + "px"); } callback(); return false;

});

dojo.connect(img, "onclick", this, function(evt){

dojo.publish(this.getClickTopicName(), [{

index: evt.target._index, data: evt.target._data, url: img.getAttribute("src"), largeUrl: this.imageStore.getValue(data,this.imageLargeAttr), title: this.imageStore.getValue(data,this.titleAttr), link: this.imageStore.getValue(data,this.linkAttr)

}]); return false;

}); dojo.addClass(img, "imageGalleryThumb"); img.setAttribute("src", url);

/* This is the patch: */

imgContainer.style.width=img.width+"px";

/* Patched by Stefano Gargiulo */

var title = this.imageStore.getValue(data, this.titleAttr); if(title){ img.setAttribute("title",title); } this._updateNavControls();

}

});

Attachments (1)

ThumbnailPicker_FF3.patch (481 bytes) - added by Shane O'Sullivan 11 years ago.
Patch to fix this issue, similar to the fix suggested in the ticket

Download all attachments as: .zip

Change History (8)

comment:1 Changed 11 years ago by guest

my e-mail address is stefano.gargiulo@…

comment:2 Changed 11 years ago by dante

Owner: changed from dante to Shane O'Sullivan

Changed 11 years ago by Shane O'Sullivan

Attachment: ThumbnailPicker_FF3.patch added

Patch to fix this issue, similar to the fix suggested in the ticket

comment:3 Changed 11 years ago by bill

Milestone: tbd

mark all (open) tickets w/blank milestones to be "tbd"; their milestones need to be set to a version number or to "future"

comment:4 Changed 11 years ago by bill

Summary: ImageGallery (ThumbinalPicker) bug on firefox 3[patch] [cla] ImageGallery (ThumbinalPicker) bug on firefox 3

comment:5 Changed 11 years ago by Shane O'Sullivan

I previously attached a patch that potentially resolved this issue. Can someone please confirm and merge it?

comment:6 Changed 11 years ago by dante

Milestone: tbd1.2
Owner: changed from Shane O'Sullivan to dante
Status: newassigned

comment:7 Changed 11 years ago by dante

Resolution: fixed
Status: assignedclosed

(In [15267]) fixes #7047 - this seems to re-align the loading indicators underneath the images as they preload. thanks sos for the patch.

Note: See TracTickets for help on using tickets.