Bug Tracker

Ticket #1306 (closed bug: wontfix)

Opened 2 years ago

Last modified 9 months ago

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

Reported by: rmarscher Assigned to: stefan
Type: bug Priority: minor
Milestone: 1.1.3 Component: interface
Version: 1.1.2 Keywords: slider
Cc: Needs: Review

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

islider.js (8.7 kB) - added by rmarscher 2 years ago.
patched islider.js

Change History

Changed 2 years ago by rmarscher

patched islider.js

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

Changed 9 months ago by scott.gonzal

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

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

Note: See TracTickets for help on using tickets.