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) { function clickTrack(data) {
// fixme: thumb ends up a bit too far on the right // fixme: thumb ends up a bit too far on the right
if (self.options.disabled) {
return;
}
var isThumb = $(data.target).hasClass('OxThumb'); var isThumb = $(data.target).hasClass('OxThumb');
self.drag = { self.drag = {
left: self.$track.offset().left, left: self.$track.offset().left,
@ -184,6 +187,9 @@ Ox.Range = function(options, self) {
} }
function dragTrack(data) { function dragTrack(data) {
if (self.options.disabled) {
return;
}
setValue( setValue(
getValue(data.clientX - self.drag.left - self.drag.offset), getValue(data.clientX - self.drag.left - self.drag.offset),
false, false,
@ -192,6 +198,9 @@ Ox.Range = function(options, self) {
} }
function dragendTrack(data) { function dragendTrack(data) {
if (self.options.disabled) {
return;
}
self.options.value = void 0; self.options.value = void 0;
setValue(getValue(data.clientX - self.drag.left - self.drag.offset), false, true); setValue(getValue(data.clientX - self.drag.left - self.drag.offset), false, true);
} }