From 47071c58aa868ee9756a98c967b64c024d22920b Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 5 Jan 2023 18:21:49 +0100 Subject: fix affinity slider updates - issue #1714 --- library/jRange/.gitignore | 2 +- library/jRange/demo/index.html | 87 +++++++++++++++++++--- library/jRange/jquery.range-min.js | 2 +- library/jRange/jquery.range.js | 146 +++++++++++++++++++++++++++---------- 4 files changed, 184 insertions(+), 53 deletions(-) (limited to 'library') diff --git a/library/jRange/.gitignore b/library/jRange/.gitignore index 089ae868a..bdedd7dd3 100644 --- a/library/jRange/.gitignore +++ b/library/jRange/.gitignore @@ -1,2 +1,2 @@ - +.DS_Store *.codekit diff --git a/library/jRange/demo/index.html b/library/jRange/demo/index.html index 19a5f33f0..61966ba22 100644 --- a/library/jRange/demo/index.html +++ b/library/jRange/demo/index.html @@ -38,17 +38,18 @@
$('.single-slider').jRange({
-    from: 0,
-    to: 100,
-    step: 1,
-    scale: [0,25,50,75,100],
+    from: -2.0,
+    to: 2.0,
+    step: 0.5,
+    scale: [-2.0,-1.0,0.0,1.0,2.0],
     format: '%s',
     width: 300,
-    showLabels: true
+    showLabels: true,
+    snap: true
 });
- +
@@ -179,6 +180,15 @@ Default : false

True if this is a range selector. If its a range the value of hidden input will be set comma-seperated, e.g., "25,75"

+ + + snap + Optional + Boolean + + Default : false +

True to snap slider to step values

+ disable @@ -203,8 +213,62 @@

For single slider value is without comma, however for a range selector value is comma-seperated.

+ + ondragend + Optional + Function + +

ondragend callback. Useful if you want to fire event just once per slider drag.

+ + + + onbarclicked + Optional + Function + +

called when user clicks on the bar

+ + +

Modification

+

Change values on runtime

+

Methods which you can call to dynamically modify current values and range. + + + + + + + + + + + + + + + + + + + +
MethodDescription
setValue +

sets the current value of the slider without changing its range, if you want to update the range as well use updateRange instead.

+ + $('.slider').jRange('setValue', '10,20');
+ $('.slider').jRange('setValue', '10'); +
+
updateRange +

'updateRange' to change (min, max) value and interval after initialized.

+ + $('.slider').jRange('updateRange', '0,100');
+ $('.slider').jRange('updateRange', '0,100', '25,50');
+ $('.slider').jRange('updateRange', '0,100', 25); +
+

passing second parameter also sets its current value

+
+

@@ -235,13 +299,14 @@