Search and Top Navigation
Ticket #4726: minrange.patch
File minrange.patch, 0.8 KB (added by gwk, July 28, 2009 01:47PM UTC)
Index: ui.slider.js
===================================================================
--- ui.slider.js (revision 2999)
+++ ui.slider.js (working copy)
@@ -337,8 +337,9 @@
var otherVal = this.values(index ? 0 : 1);
if ((this.options.values.length == 2 && this.options.range === true) &&
- ((index == 0 && newVal > otherVal) || (index == 1 && newVal < otherVal))){
- newVal = otherVal;
+ ((index == 0 && newVal > (otherVal - this.options.minRange)) ||
+ (index == 1 && newVal < (otherVal + this.options.minRange)))){
+ newVal = otherVal + this.options.minRange * (index * 2 - 1);
}
if (newVal != this.values(index)) {
@@ -550,7 +551,8 @@
range: false,
step: 1,
value: 0,
- values: null
+ values: null,
+ minRange: 0
})
});
Download in other formats:
Original Format
File minrange.patch, 0.8 KB (added by gwk, July 28, 2009 01:47PM UTC)
Index: ui.slider.js
===================================================================
--- ui.slider.js (revision 2999)
+++ ui.slider.js (working copy)
@@ -337,8 +337,9 @@
var otherVal = this.values(index ? 0 : 1);
if ((this.options.values.length == 2 && this.options.range === true) &&
- ((index == 0 && newVal > otherVal) || (index == 1 && newVal < otherVal))){
- newVal = otherVal;
+ ((index == 0 && newVal > (otherVal - this.options.minRange)) ||
+ (index == 1 && newVal < (otherVal + this.options.minRange)))){
+ newVal = otherVal + this.options.minRange * (index * 2 - 1);
}
if (newVal != this.values(index)) {
@@ -550,7 +551,8 @@
range: false,
step: 1,
value: 0,
- values: null
+ values: null,
+ minRange: 0
})
});