Skip to content

Commit 897e0af

Browse files
committed
Fixed setting val by integer
1 parent 7e76fc8 commit 897e0af

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

jquery.nouislider.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,8 +742,14 @@
742742
function val ( args, ignore ) {
743743

744744
// Setter
745-
if( args && args.length ){
745+
if( args !== UNDEF ){
746746

747+
// If the val is to be set to a number, which is valid
748+
// when using a one-handle slider, wrap it in an array.
749+
if(!$.isArray(args)){
750+
args = [args];
751+
}
752+
747753
// Setting is handled properly for each slider in the data set.
748754
return this.each(function(){
749755

jquery.nouislider.min.js

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)