Skip to content

Commit

Permalink
Merge pull request #148 from piever/pv/slider
Browse files Browse the repository at this point in the history
fix both sliders
  • Loading branch information
Pietro Vertechi authored Jun 4, 2019
2 parents 0c846c6 + 0e0299a commit 31c314c
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

2 comments on commit 31c314c

@piever
Copy link
Collaborator

@piever piever commented on 31c314c Jun 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/1176

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if Julia TagBot is installed, or can be done manually through the github interface, or via:

git tag -a v0.10.2 -m "<description of version>" 31c314cf26873dbedb1322a51622c3a01d7f32d3
git push origin v0.10.2

Please sign in to comment.