Skip to content

Commit

Permalink
fix both sliders
Browse files Browse the repository at this point in the history
  • Loading branch information
Pietro Vertechi committed Jun 4, 2019
1 parent 0c846c6 commit 0e0299a
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/slider.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function slider(::WidgetTheme, vals::AbstractUnitRange{<:Integer}, formatted_val
(value isa AbstractObservable) || (value = convert(eltype(vals), value))
format = js"""
function(){
return this.formatted_vals()[parseInt(this.index())-$min];
return this.formatted_vals()[parseInt(this.index())-($min)];
}
"""
ui = input(value; bindto="index", attributes=attributes, extra_obs = ["formatted_vals" => formatted_vals], computed = ["formatted_val" => format],
Expand Down Expand Up @@ -123,17 +123,17 @@ function rangeslider(theme::WidgetTheme, vals::AbstractUnitRange{<:Integer}, for
connect: $connect,
orientation: $orientation,
format: {
to: function ( value ) {
var ind = Math.round(value-$min);
return ind + 1 > vals.length ? vals[vals.length - 1] : vals[ind];
},
from: function ( value ) {
return value;
}
to: function ( value ) {
var ind = Math.round(value-($min));
return ind + 1 > vals.length ? vals[vals.length - 1] : vals[ind];
},
from: function ( value ) {
return parseInt(value);
}
},
range: {
'min': $min,
'max': $max
'min': ($min),
'max': ($max)
},})
slider.noUiSlider.on("slide", updateValue);
Expand Down

0 comments on commit 0e0299a

Please sign in to comment.