-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Slider: Setting values or range slider to max, doesn't lock slider #1502
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
Closed
Closed
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
62907dc
Slider: Setting values or range slider to max, doesn't lock slider
atomiomi 5dac65f
Slider: Unit test for setting both values of range slider to the max
atomiomi 00ce97f
Slider: Unit test for setting both values of range slider to the min
atomiomi 1f0353a
Slider: Separate method for change all values removed
atomiomi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head lang="en"> | ||
<meta charset="UTF-8"> | ||
<title>jQuery UI Slider - Range slider</title> | ||
<link rel="stylesheet" href="../../../themes/base/all.css"> | ||
<style> | ||
#wrapper { | ||
font-family: Arial; | ||
width: 500px; | ||
margin: 20px auto; | ||
} | ||
</style> | ||
<script src="../../../external/jquery/jquery.js"></script> | ||
<script src="../../../ui/core.js"></script> | ||
<script src="../../../ui/widget.js"></script> | ||
<script src="../../../ui/mouse.js"></script> | ||
<script src="../../../ui/slider.js"></script> | ||
</head> | ||
<body> | ||
<div id="wrapper"> | ||
<h1>Range Slider</h1> | ||
<h3>When set both values of range slider to the maximum, slider should not lock</h3> | ||
<div id="slider"></div> | ||
<br> | ||
<button id="set-max-values">set values to max</button> | ||
<button id="set-min-values">set values to min</button> | ||
</div> | ||
|
||
<script> | ||
var el = $( "#slider" ).slider({ | ||
range: true, | ||
min: 0, | ||
max: 100, | ||
values: [ 0, 50 ] | ||
}); | ||
|
||
$( "#set-max-values" ).on( "click", function() { | ||
el.slider( "option", { values: [ 100, 100 ] } ); | ||
}); | ||
|
||
$( "#set-min-values" ).on( "click", function() { | ||
el.slider( "option", { values: [ 0, 0 ] } ); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is this check actually necessary? Might be enough to just always do the reverse loop. I tested that locally with the new visual test page and the unit tests, works for both.
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.
Yes, I've also tested that, it works well. I thought that setting values with reverse loop to the minimum will lock slider, but didn't check it.