Bug Tracker

Opened 16 years ago

Closed 15 years ago

#1306 closed bug (wontfix)

Interface: Slider fractions are incorrectly reset when restricted is enabled with two indicators

Reported by: rmarscher Owned by: stefan
Priority: minor Milestone: 1.1.3
Component: interface Version: 1.1.2
Keywords: slider Cc:
Blocked by: Blocking:


Here's how I can replicate this problem. Setup a horizontal slider with two indicators, restricted set to true, and fractions set to 10. Move the two indicators away from the end points of the slider. Now move them again. You should see that the fractions have been reset to be determined by the new width between the indicators rather than the total width of the slider.

I was able to fix this by editing modifyContainer in islider.js and moving the "if(elm.dragCfg.fractions) {" block above the "if (elm.SliderContainer.slideCfg.restricted ) {" block. I haven't tested many cases, but this change doesn't seem to cause any side effects. I've attached my edited islider.js. Hope it helps.

I saw this problem was mentioned in the jQuery google group. I responded to that as well. http://groups.google.com/group/jquery-en/browse_thread/thread/4436dfe39e5415ef

Attachments (1)

islider.js (8.7 KB) - added by rmarscher 16 years ago.
patched islider.js

Download all attachments as: .zip

Change History (3)

Changed 16 years ago by rmarscher

Attachment: islider.js added

patched islider.js

comment:1 Changed 16 years ago by rmarscher

I found a related bug... the percentages returned by SliderGetValues() are also incorrect when you have two indicators moved in from the end points. Commenting out the fractions conditional in onSlide fixes it for me... but I feel like I surely must be breaking some other functionality. Let me know if you want me to supply more example code that illustrates the problems I've encountered. Thanks!

	onSlide : function(elm, x, y)
//		if (elm.dragCfg.fractions) {
//				xfrac = parseInt(x/elm.dragCfg.fracW);
//				xproc = xfrac * 100 / elm.dragCfg.fractions;
//				yfrac = parseInt(y/elm.dragCfg.fracH);
//				yproc = yfrac * 100 / elm.dragCfg.fractions;
//		} else {
			xproc = parseInt(x * 100 / elm.dragCfg.containerMaxx);
			yproc = parseInt(y * 100 / elm.dragCfg.containerMaxy);
//		}
		elm.dragCfg.lastSi = [xproc||0, yproc||0, x||0, y||0];
		if (elm.dragCfg.onSlide)
			elm.dragCfg.onSlide.apply(elm, elm.dragCfg.lastSi);

comment:2 Changed 15 years ago by scott.gonzal

Resolution: wontfix
Status: newclosed

Interface is no longer supported; consider switching to jQuery UI.

Note: See TracTickets for help on using tickets.