mirror of
https://github.com/s00500/ESPUI.git
synced 2025-07-04 06:10:18 +00:00
Fixes #127
This commit is contained in:
39
data/js/controls.js
vendored
39
data/js/controls.js
vendored
@ -896,31 +896,24 @@ function switcher(number, state) {
|
||||
}
|
||||
|
||||
var rangeSlider = function (isDiscrete) {
|
||||
var slider = $(".range-slider"),
|
||||
range = $(".range-slider__range"),
|
||||
value = $(".range-slider__value");
|
||||
var range = $(".range-slider__range");
|
||||
var slidercb = function() {
|
||||
sliderchange($(this).attr("id").replace(/^\D+/g, ""));
|
||||
};
|
||||
|
||||
slider.each(function () {
|
||||
value.each(function () {
|
||||
var value = $(this).prev().attr("value");
|
||||
$(this).html(value);
|
||||
});
|
||||
range.on({input: function() {
|
||||
$(this).next().html(this.value)}
|
||||
});
|
||||
|
||||
if (!isDiscrete) {
|
||||
range.on({
|
||||
input: function () {
|
||||
sliderchange($(this).attr("id").replace(/^\D+/g, ""));
|
||||
},
|
||||
});
|
||||
} else {
|
||||
range.on({
|
||||
input: function () {
|
||||
$(this).next().html(this.value);
|
||||
},
|
||||
change: function () {
|
||||
sliderchange($(this).attr("id").replace(/^\D+/g, ""));
|
||||
},
|
||||
});
|
||||
range.each(function() {
|
||||
$(this).next().html(this.value);
|
||||
if($(this).attr("callbackSet") != "true") {
|
||||
if (!isDiscrete) {
|
||||
$(this).on({input: slidercb}); //input fires when dragging
|
||||
} else {
|
||||
$(this).on({change: slidercb}); //change fires only once released
|
||||
}
|
||||
$(this).attr("callbackSet", "true");
|
||||
}
|
||||
});
|
||||
};
|
||||
|
Reference in New Issue
Block a user