Commit edf6a0dd authored by Rafal Zajac's avatar Rafal Zajac

Ignore tracking when validator returns false

parent 4ef2ddd1
This diff is collapsed.
...@@ -180,6 +180,8 @@ function throttle(func, wait, options) { ...@@ -180,6 +180,8 @@ function throttle(func, wait, options) {
this.maxLab = null; // Label above the high value this.maxLab = null; // Label above the high value
this.cmbLab = null; // Combined label this.cmbLab = null; // Combined label
this.ignoreTracking = false;
// Initialize slider // Initialize slider
this.init(); this.init();
}; };
...@@ -759,7 +761,7 @@ function throttle(func, wait, options) { ...@@ -759,7 +761,7 @@ function throttle(func, wait, options) {
newOffset = eventX - sliderLO - this.handleHalfWidth, newOffset = eventX - sliderLO - this.handleHalfWidth,
newValue; newValue;
if(newOffset <= 0) if(newOffset <= 0 && ! this.ignoreTracking)
{ {
if(pointer.rzsl !== 0) if(pointer.rzsl !== 0)
{ {
...@@ -771,7 +773,7 @@ function throttle(func, wait, options) { ...@@ -771,7 +773,7 @@ function throttle(func, wait, options) {
return; return;
} }
if(newOffset >= this.maxLeft) if(newOffset >= this.maxLeft && ! this.ignoreTracking)
{ {
if(pointer.rzsl !== this.maxLeft) if(pointer.rzsl !== this.maxLeft)
{ {
...@@ -790,11 +792,13 @@ function throttle(func, wait, options) { ...@@ -790,11 +792,13 @@ function throttle(func, wait, options) {
{ {
if(this.tracking === 'rzSliderModel' && ! this.customVlFn(newValue, this.scope['rzSliderHigh'], this.minValue, this.maxValue)) if(this.tracking === 'rzSliderModel' && ! this.customVlFn(newValue, this.scope['rzSliderHigh'], this.minValue, this.maxValue))
{ {
this.ignoreTracking = true;
// this.onEnd(event); // this.onEnd(event);
return; return;
} }
else if(this.tracking === 'rzSliderHigh' && ! this.customVlFn(this.scope['rzSliderModel'], newValue, this.minValue, this.maxValue)) else if(this.tracking === 'rzSliderHigh' && ! this.customVlFn(this.scope['rzSliderModel'], newValue, this.minValue, this.maxValue))
{ {
this.ignoreTracking = true;
// this.onEnd(event); // this.onEnd(event);
return; return;
} }
...@@ -848,6 +852,7 @@ function throttle(func, wait, options) { ...@@ -848,6 +852,7 @@ function throttle(func, wait, options) {
} }
this.tracking = ''; this.tracking = '';
this.ignoreTracking = false;
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment