Ticket #5650 (closed defect: fixed)

Opened 10 months ago

Last modified 9 months ago

dojox.image.ThumbnailPicker don't scroll to previous images

Reported by: guest Owned by: dante
Priority: normal Milestone: 1.1
Component: Dojox Version: 1.0
Severity: normal Keywords:
Cc:

Description

Try in tests

dojox/image/tests/test_ThumbnailPicker.html

go forward and then try to go back, it doesn't work.
No exception or other error, simply don't move.

Change History

Changed 10 months ago by peller

  • owner changed from peller to dante

Changed 10 months ago by guest

Actually it looks like it just won't scroll back to the first page of images; if you advance to the third page or beyond you can go back again as far as the second page. It's probably got an off-by-one error in its _prev() function (which in its comment is incorrectly claiming it'll display the next page of thumbnails rather than the previous one).

Changed 10 months ago by guest

Yup, a quick test shows that if the line:

if(this.thumbScroller[this.isHorizontal ? "scrollLeft" : "scrollTop"] == 0){return;}

in _prev() is changed to:

if(this.thumbScroller[this.isHorizontal ? "scrollLeft" : "scrollTop"] < 0){return;}

then the bug goes away.

Changed 10 months ago by guest

Interestingly the above fix works in 1.0.2 but not the nightlies. It appears that a change made to the _showThumbs() function also causes the broken behavior; changing:

var idx = arguments.length == 0 ? this._thumbIndex : arguments[0];

to

if(!idx){ idx = this._thumbIndex; }

also causes the bug to occur, since idx can legitimately be 0 for the first image. Reverting this change plus applying the change above fixes it in the nightlies.

Changed 9 months ago by dante

  • status changed from new to closed
  • resolution set to fixed

(In [12383]) fixes #5820 (dup and patch) and fixes #5650 (orig) ... patch from Shane O'Sullivan - fixes Thumbnailpicker going to first image.

Changed 9 months ago by dante

  • milestone set to 1.1
Note: See TracTickets for help on using tickets.