Bug Tracker

Modify

Ticket #1306 (closed bug: wontfix)

Opened 6 years ago

Last modified 5 years ago

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:
Blocking: Blocked by:

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 Download (8.7 KB) - added by rmarscher 6 years ago.
patched islider.js

Change History

Changed 6 years ago by rmarscher

patched islider.js

comment:1 Changed 6 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 5 years ago by scott.gonzal

  • Status changed from new to closed
  • Resolution set to wontfix

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

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.