mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update Variable declerations for taskbutton and touchHelper
This commit is contained in:
parent
0473e549ab
commit
46638fb9a9
2 changed files with 33 additions and 33 deletions
|
@ -9,23 +9,23 @@ class TouchHelper {
|
|||
constructor(elem, options) {
|
||||
|
||||
options = options || {};
|
||||
var touchTarget;
|
||||
var touchStartX;
|
||||
var touchStartY;
|
||||
var lastDeltaX;
|
||||
var lastDeltaY;
|
||||
var thresholdYMet;
|
||||
var self = this;
|
||||
let touchTarget;
|
||||
let touchStartX;
|
||||
let touchStartY;
|
||||
let lastDeltaX;
|
||||
let lastDeltaY;
|
||||
let thresholdYMet;
|
||||
const self = this;
|
||||
|
||||
var swipeXThreshold = options.swipeXThreshold || 50;
|
||||
var swipeYThreshold = options.swipeYThreshold || 50;
|
||||
var swipeXMaxY = 30;
|
||||
const swipeXThreshold = options.swipeXThreshold || 50;
|
||||
const swipeYThreshold = options.swipeYThreshold || 50;
|
||||
const swipeXMaxY = 30;
|
||||
|
||||
var excludeTagNames = options.ignoreTagNames || [];
|
||||
const excludeTagNames = options.ignoreTagNames || [];
|
||||
|
||||
var touchStart = function (e) {
|
||||
const touchStart = function (e) {
|
||||
|
||||
var touch = getTouches(e)[0];
|
||||
const touch = getTouches(e)[0];
|
||||
touchTarget = null;
|
||||
touchStartX = 0;
|
||||
touchStartY = 0;
|
||||
|
@ -35,7 +35,7 @@ class TouchHelper {
|
|||
|
||||
if (touch) {
|
||||
|
||||
var currentTouchTarget = touch.target;
|
||||
const currentTouchTarget = touch.target;
|
||||
|
||||
if (dom.parentWithTag(currentTouchTarget, excludeTagNames)) {
|
||||
return;
|
||||
|
@ -47,18 +47,18 @@ class TouchHelper {
|
|||
}
|
||||
};
|
||||
|
||||
var touchEnd = function (e) {
|
||||
const touchEnd = function (e) {
|
||||
|
||||
var isTouchMove = e.type === 'touchmove';
|
||||
const isTouchMove = e.type === 'touchmove';
|
||||
|
||||
if (touchTarget) {
|
||||
var touch = getTouches(e)[0];
|
||||
const touch = getTouches(e)[0];
|
||||
|
||||
var deltaX;
|
||||
var deltaY;
|
||||
let deltaX;
|
||||
let deltaY;
|
||||
|
||||
var clientX;
|
||||
var clientY;
|
||||
let clientX;
|
||||
let clientY;
|
||||
|
||||
if (touch) {
|
||||
clientX = touch.clientX || 0;
|
||||
|
@ -70,8 +70,8 @@ class TouchHelper {
|
|||
deltaY = 0;
|
||||
}
|
||||
|
||||
var currentDeltaX = lastDeltaX == null ? deltaX : (deltaX - lastDeltaX);
|
||||
var currentDeltaY = lastDeltaY == null ? deltaY : (deltaY - lastDeltaY);
|
||||
const currentDeltaX = lastDeltaX == null ? deltaX : (deltaX - lastDeltaX);
|
||||
const currentDeltaY = lastDeltaY == null ? deltaY : (deltaY - lastDeltaY);
|
||||
|
||||
lastDeltaX = deltaX;
|
||||
lastDeltaY = deltaY;
|
||||
|
@ -140,11 +140,11 @@ class TouchHelper {
|
|||
}
|
||||
destroy() {
|
||||
|
||||
var elem = this.elem;
|
||||
const elem = this.elem;
|
||||
|
||||
if (elem) {
|
||||
var touchStart = this.touchStart;
|
||||
var touchEnd = this.touchEnd;
|
||||
const touchStart = this.touchStart;
|
||||
const touchEnd = this.touchEnd;
|
||||
|
||||
dom.removeEventListener(elem, 'touchstart', touchStart, {
|
||||
passive: true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue