1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Merge remote-tracking branch 'upstream/master' into perfect_slider-2

This commit is contained in:
Dmitry Lyzo 2020-02-19 11:11:32 +03:00
commit bafac46a33
26 changed files with 165 additions and 64 deletions

View file

@ -267,24 +267,40 @@ define(['browser', 'dom', 'layoutManager', 'keyboardnavigation', 'css!./emby-sli
cancelable: false
}));
// Reset dragging (from 'input' event) so that real dragging can be detected
var range = this;
setTimeout(function () {
range.dragging = false;
}, 0);
// Prevent 'pointermove' and 'click' after 'touch*'
// FIXME: Still have some 'pointermove' and 'click' that bypass 'touchstart'
e.preventDefault();
}, {
capture: true
});
dom.addEventListener(this, 'touchmove', function (e) {
if (!this.touched || e.targetTouches.length !== 1) {
return;
}
var fraction = mapClientToFraction(this, e.targetTouches[0].clientX);
this.value = mapFractionToValue(this, fraction);
this.dispatchEvent(new Event('input', {
bubbles: true,
cancelable: false
}));
}, {
passive: true
});
dom.addEventListener(this, 'touchend', function (e) {
if (!this.dragging) {
this.dispatchEvent(new Event('change', {
var range = this;
setTimeout(function () {
range.touched = false;
range.dispatchEvent(new Event('change', {
bubbles: true,
cancelable: false
}));
}
this.touched = false;
}, 0);
}, {
passive: true
});