From 1d82b10c54b3252bcfbc9fbac8099757cfdfaa97 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Abel=20Mui=C3=B1o?=
Date: Wed, 20 Nov 2013 10:53:09 +0100
Subject: [PATCH] Make change event always fire as the user interacts with the
knob
That is, when using:
- touch
- wheel
- typing (by binding to the "input" event)
Previously, typing did not update the knob until focus was lost (and
no change event was fired), and
using the keyboard arrows did not fire any change events.
Also move event triggering to val() and change() so it works always
in the same way and less duplication exists.
Similar to #130 but fixes an issue with `diplayPrevious`
---
index.html | 5 +++--
js/jquery.knob.js | 43 +++++++++++++++----------------------------
2 files changed, 18 insertions(+), 30 deletions(-)
diff --git a/index.html b/index.html
index 7184b74..9352ab0 100755
--- a/index.html
+++ b/index.html
@@ -60,7 +60,8 @@
return false;
}
- }
+ },
+ change: function (val) { console.log("Change: " + val) }
});
// Example of infinite knob, iPod click wheel
@@ -309,4 +310,4 @@ jQuery Knob
jQuery Knob is © 2012 Anthony Terrien and dual licensed under the MIT or GPL licenses.