Skip to content

Commit

Permalink
Add continuous_update option to slider, default to true. Fixes #85
Browse files Browse the repository at this point in the history
  • Loading branch information
shashi committed Jan 20, 2016
1 parent 17f8864 commit 0cc46c6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/IJulia/statedict.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
@compat Dict(:value=>s.value,
:min=>first(s.range),
:step=>step(s.range),
:max=>last(s.range))
:max=>last(s.range),
:continuous_update=>s.continuous_update,
)

# when we say value to javascript, it really means value label
statedict(d::Options) =
Expand Down
6 changes: 4 additions & 2 deletions src/widgets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ type Slider{T<:Number} <: InputWidget{T}
label::AbstractString
value::T
range::Range{T}
continuous_update::Bool
end

# differs from median(r) in that it always returns an element of the range
Expand All @@ -25,8 +26,9 @@ slider(args...) = Slider(args...)
slider{T}(range::Range{T};
value=medianelement(range),
signal::Signal{T}=Signal(value),
label="") =
Slider(signal, label, value, range)
label="",
continuous_update=true) =
Slider(signal, label, value, range, continuous_update)

######################### Checkbox ###########################

Expand Down

0 comments on commit 0cc46c6

Please sign in to comment.