Opened 9 years ago

Closed 7 years ago

#11881 closed defect (patchwelcome)

dojox.image.ThumbnailPicker produces incorrect animation

Reported by: jer Owned by: Shane O'Sullivan
Priority: blocker Milestone: 1.9
Component: Dojox Version: 1.5
Keywords: ThumbnailPicker scroll Cc:
Blocked By: Blocking:

Description

lines 384-393 (1.5.0) in dojox.image.ThumbnailPicker?

		if(this.isScrollable){
			var target = this.isHorizontal ? {x: left, y: 0} : { x:0, y:top};
			dojox.fx.smoothScroll({
				target: target,
				win: this.thumbScroller,
				duration:300,
				easing:dojo.fx.easing.easeOut,
				onEnd: dojo.hitch(this, "_checkLoad", img, index)
			}).play(10);
		}

produce incorrect animation, cause dojox.fx.smoothScroll subtract element's absolute position in viewport from position it's going to scroll to:

	if(!isWindow){
		var winPos = dojo.position(args.win);
		delta.x -= winPos.x;
		delta.y -= winPos.y;
	}

finally less scrolling than required is done and all the scrolling is broken, cause picker's internal position pointer doesn't match actual image.

Change History (10)

comment:1 Changed 9 years ago by Adam Peller

Milestone: 1.5.1tbd
Owner: changed from Adam Peller to dante

comment:2 Changed 9 years ago by dante

Owner: changed from dante to Shane O'Sullivan

comment:3 Changed 9 years ago by mpasternak

+1, I confirm this bug.

comment:4 Changed 9 years ago by hungerburg

+1, confirm needs love

This only became visible to me in 1.6. because of lousy developer practices, I cannot go back to verify 1.5. thumbnail scrolling is a mess in my page. the original description looks quite to the point of it: e.g. showThumb(0) scrolls a mere 125 pixels instead of 2000 and some.

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

I'll take a look at this soon. I wish people would stop hacking on it, it was working fine before.

comment:6 Changed 9 years ago by Shane O'Sullivan

Status: newassigned

comment:7 Changed 8 years ago by hungerburg

After studying the nuisance in more detail, I can tell how to temptatively fix the behaviour of thumbNail scrolling. Of course this will break all the rest of dojo, so please read as a further point for your own investigations:

	if(!isWindow){
                delta.x -= args.win.scrollLeft;
                delta.y -= args.win.scrollTop;
	}

This change to dojox.fx.smoothScroll is quite simple, but performs very well in my case; thumbnail scrolling now works even better than in 1.4, as it scrolls exactly to the left corner of the image, that was invisible (RTL) or only partially visible (LTR).

Possibly a flag to tell smooth scroll whether to anchor at the viewport or at the node was more portable… The nuisance was introduced in changeset:21827 for dojox/trunk/fx/scroll.js

comment:8 Changed 8 years ago by Colin Snover

Priority: highblocker

Bulk update of open ticket priorities.

comment:9 Changed 8 years ago by hungerburg

The change in dojox/fx/scroll.js applies the same to 1.7.1 and fixes thumbnail scrolling there too.

comment:10 Changed 7 years ago by dylan

Milestone: tbd1.9
Resolution: patchwelcome
Status: assignedclosed

A patch to fix this would be welcome. Given the lack of activity, closing to the patchwelcome state.

Note: See TracTickets for help on using tickets.