From dcbee18584fc8cbef0e1a302292fe1bc644059c2 Mon Sep 17 00:00:00 2001 From: rlx Date: Sun, 21 Jan 2018 09:40:05 +0100 Subject: [PATCH] Ox.Range: properly disable track --- source/UI/js/Form/Range.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/UI/js/Form/Range.js b/source/UI/js/Form/Range.js index 355e6008..97bb7a46 100644 --- a/source/UI/js/Form/Range.js +++ b/source/UI/js/Form/Range.js @@ -175,6 +175,9 @@ Ox.Range = function(options, self) { function clickTrack(data) { // fixme: thumb ends up a bit too far on the right + if (self.options.disabled) { + return; + } var isThumb = $(data.target).hasClass('OxThumb'); self.drag = { left: self.$track.offset().left, @@ -184,6 +187,9 @@ Ox.Range = function(options, self) { } function dragTrack(data) { + if (self.options.disabled) { + return; + } setValue( getValue(data.clientX - self.drag.left - self.drag.offset), false, @@ -192,6 +198,9 @@ Ox.Range = function(options, self) { } function dragendTrack(data) { + if (self.options.disabled) { + return; + } self.options.value = void 0; setValue(getValue(data.clientX - self.drag.left - self.drag.offset), false, true); }