Skip to main content

Bug Tracker

Side navigation

#1306 closed bug (wontfix)

Opened June 19, 2007 08:01PM UTC

Closed March 31, 2008 02:18AM UTC

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:
Description

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 June 19, 2007 08:02PM UTC.

    patched islider.js

Change History (2)

Changed June 20, 2007 06:18PM UTC by rmarscher comment:1

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);
	},

Changed March 31, 2008 02:18AM UTC by scott.gonzal comment:2

resolution: → wontfix
status: newclosed

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