From 0cc46c62b9d813a9fd5dac2cdac44d9232cd900b Mon Sep 17 00:00:00 2001 From: Shashi Gowda Date: Wed, 20 Jan 2016 14:48:52 +0530 Subject: [PATCH] Add continuous_update option to slider, default to true. Fixes #85 --- src/IJulia/statedict.jl | 4 +++- src/widgets.jl | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/IJulia/statedict.jl b/src/IJulia/statedict.jl index 0b63811..59e80d5 100644 --- a/src/IJulia/statedict.jl +++ b/src/IJulia/statedict.jl @@ -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) = diff --git a/src/widgets.jl b/src/widgets.jl index cd6028d..23e8cc8 100644 --- a/src/widgets.jl +++ b/src/widgets.jl @@ -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 @@ -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 ###########################