Ox.Range: properly disable track

This commit is contained in:
rlx 2018-01-21 09:40:05 +01:00
parent 719cfeac13
commit dcbee18584

View file

@ -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);
}