-
-
Notifications
You must be signed in to change notification settings - Fork 495
Draggable range #100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draggable range #100
Conversation
this.minH.addClass('rz-active'); | ||
this.maxH.addClass('rz-active'); | ||
|
||
this.onStart(pointer, ref, event, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is true here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean the active: true
property? It's used in onStart
to determine which move handler (onMove
or onDragMove
) is used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I thought the comment was attached to a unique line...
I was talking about the true in:
this.onStart(pointer, ref, event, true);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that's a mistake. Originally I was passing an extra argument to onStart
, but now it's using this.dragging.active
. I'll remove the extra true
.
Thanks for this PR, this is a pretty cool work! Just a few remarks:
|
@@ -508,6 +529,13 @@ function throttle(func, wait, options) { | |||
this.maxH.remove(); | |||
this.selBar.remove(); | |||
} | |||
|
|||
// If using draggable range, use appropriate cursor for this.fullBar. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.fullbar -> this.selBar
Cool, thanks!
|
I think that's everything! |
Yeap this looks good to me. One last remark: now if you click just above the range, the min handle moves. I think that the perfect behaviour would be to drag the range bar when clicking between the min and max handles. Currently, the handle the clicks outside the bars, we have a bar wrapper to enlarge the clickable zone. Maybe it would nice to have the same around the selBar... |
I manage to do it like this: in the .less file: rzslider span.rz-bar.rz-selection {
//removed the width: 0%
z-index: 1;
background: @barFillColor;
.rounded(@barHeight/2);
} in the .js file, I wrapped the var template = '<span class="rz-bar-wrapper"><span class="rz-bar"></span></span>' + // 0 The slider bar
'<span class="rz-bar-wrapper"><span class="rz-bar rz-selection"></span></span>' + // 1 Highlight between two handles
'<span class="rz-pointer"></span>' + // 2 Left slider handle
'<span class="rz-pointer"></span>' + // 3 Right slider handle
'<span class="rz-bubble rz-limit"></span>' + // 4 Floor label
'<span class="rz-bubble rz-limit"></span>' + // 5 Ceiling label
'<span class="rz-bubble"></span>' + // 6 Label above left slider handle
'<span class="rz-bubble"></span>' + // 7 Label above right slider handle
'<span class="rz-bubble"></span>'; // 8 Range label when the slider handles are close ex. 15 - 17 Could you please try it and tell me what you think? |
Last but not least: don't forget to run the |
That was quick ^^. I'll try it out now - and commit the dist files :) |
Looks good to me! I'll commit it and include in the PR. |
There are conflictuels apparently... Can you rebase on top of the master? I pushed a commit yesterday. That might be the reason. |
I think the conflicts may have appeared because of the dist file changes, but I'll rebase and check again. |
Rebased! |
Actually, again about rebasing, can you rebase everything and merge all your commit into one? |
OK, rebased and squashed! Sorry for the delay. |
Perfect! |
This is a great feature, wondering if it would be possible to lock the range length? |
You mean that the user would not be able to drag a single toggle and only drag the whole range? |
Adds an option to make the range draggable when in use.