From 5c01d6d39f39c4da83dbc268b837a0ff5b584a85 Mon Sep 17 00:00:00 2001 From: eric Date: Tue, 24 Nov 2015 15:18:28 -0800 Subject: [PATCH] Listen for 'refresh' event to trigger value update without 'release' event notification - allows updating of knob state without triggering an event feedback loop --- js/jquery.knob.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/js/jquery.knob.js b/js/jquery.knob.js index 792313c..0e600bd 100644 --- a/js/jquery.knob.js +++ b/js/jquery.knob.js @@ -162,6 +162,15 @@ s.val(s._validate(val)); } ); + + $this.bind( + 'refresh', + function () { + var val = {}; + val[k] = $this.val(); + s.val(s._validate(val), false); + } + ); }); this.$.find('legend').remove(); } else { @@ -177,6 +186,13 @@ } ); + this.$.bind( + 'refresh', + function () { + s.val(s._validate(s.o.parse(s.$.val())), false); + } + ); + } !this.o.displayInput && this.$.hide();