store chapter image date modified
This commit is contained in:
parent
8c175cbbbd
commit
6e90fe1460
8 changed files with 38 additions and 22 deletions
|
@ -22,18 +22,20 @@
|
|||
// range.classList.remove('is-lowest-value');
|
||||
//}
|
||||
|
||||
if (backgroundLower) {
|
||||
var fraction = (range.value - range.min) / (range.max - range.min);
|
||||
var value = range.value;
|
||||
requestAnimationFrame(function () {
|
||||
|
||||
backgroundLower.style.flex = fraction;
|
||||
backgroundLower.style.webkitFlex = fraction;
|
||||
backgroundUpper.style.flex = 1 - fraction;
|
||||
backgroundUpper.style.webkitFlex = 1 - fraction;
|
||||
}
|
||||
if (backgroundLower) {
|
||||
var fraction = (value - range.min) / (range.max - range.min);
|
||||
|
||||
backgroundLower.style.flex = fraction;
|
||||
backgroundUpper.style.flex = 1 - fraction;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function updateBubble(range, bubble) {
|
||||
|
||||
|
||||
var value = range.value;
|
||||
bubble.style.left = (value - 1) + '%';
|
||||
|
||||
|
@ -71,15 +73,22 @@
|
|||
var backgroundUpper = containerElement.querySelector('.mdl-slider__background-upper');
|
||||
var sliderBubble = containerElement.querySelector('.sliderBubble');
|
||||
|
||||
var hasHideClass = sliderBubble.classList.contains('hide');
|
||||
|
||||
this.addEventListener('input', function (e) {
|
||||
this.dragging = true;
|
||||
updateBubble(this, sliderBubble);
|
||||
sliderBubble.classList.remove('hide');
|
||||
|
||||
if (hasHideClass) {
|
||||
sliderBubble.classList.remove('hide');
|
||||
hasHideClass = false;
|
||||
}
|
||||
});
|
||||
this.addEventListener('change', function () {
|
||||
this.dragging = false;
|
||||
updateValues(this, backgroundLower, backgroundUpper);
|
||||
sliderBubble.classList.add('hide');
|
||||
hasHideClass = true;
|
||||
});
|
||||
|
||||
if (!supportsNativeProgressStyle) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue