mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update components
This commit is contained in:
parent
e6183509f8
commit
c01a55384e
26 changed files with 296 additions and 115 deletions
|
@ -15,12 +15,12 @@
|
|||
},
|
||||
"devDependencies": {},
|
||||
"ignore": [],
|
||||
"version": "1.4.74",
|
||||
"_release": "1.4.74",
|
||||
"version": "1.4.75",
|
||||
"_release": "1.4.75",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "1.4.74",
|
||||
"commit": "8612284330cb4e7fa444de71a5f1d21f2b9490b4"
|
||||
"tag": "1.4.75",
|
||||
"commit": "bd530f76973adf0e2cbf9df0f38590d7a077de8e"
|
||||
},
|
||||
"_source": "https://github.com/MediaBrowser/emby-webcomponents.git",
|
||||
"_target": "^1.2.0",
|
||||
|
|
|
@ -743,6 +743,14 @@
|
|||
target.addEventListener(type, handler, optionsOrCapture);
|
||||
}
|
||||
|
||||
function removeEventListenerWithOptions(target, type, handler, options) {
|
||||
var optionsOrCapture = options;
|
||||
if (!supportsCaptureOption) {
|
||||
optionsOrCapture = options.capture;
|
||||
}
|
||||
target.removeEventListener(type, handler, optionsOrCapture);
|
||||
}
|
||||
|
||||
function onTimerCreated(e, apiClient, data) {
|
||||
|
||||
var programId = data.ProgramId;
|
||||
|
|
|
@ -109,6 +109,14 @@ define(['visibleinviewport', 'imageFetcher', 'layoutManager', 'events', 'browser
|
|||
target.addEventListener(type, handler, optionsOrCapture);
|
||||
}
|
||||
|
||||
function removeEventListenerWithOptions(target, type, handler, options) {
|
||||
var optionsOrCapture = options;
|
||||
if (!supportsCaptureOption) {
|
||||
optionsOrCapture = options.capture;
|
||||
}
|
||||
target.removeEventListener(type, handler, optionsOrCapture);
|
||||
}
|
||||
|
||||
function unveilWithIntersection(images, root) {
|
||||
|
||||
var filledCount = 0;
|
||||
|
@ -177,10 +185,22 @@ define(['visibleinviewport', 'imageFetcher', 'layoutManager', 'events', 'browser
|
|||
}
|
||||
|
||||
if (!images.length) {
|
||||
document.removeEventListener('focus', unveil, true);
|
||||
document.removeEventListener('scroll', unveil, true);
|
||||
document.removeEventListener(wheelEvent, unveil, true);
|
||||
window.removeEventListener('resize', unveil, true);
|
||||
removeEventListenerWithOptions(document, 'focus', unveil, {
|
||||
capture: true,
|
||||
passive: true
|
||||
});
|
||||
removeEventListenerWithOptions(document, 'scroll', unveil, {
|
||||
capture: true,
|
||||
passive: true
|
||||
});
|
||||
removeEventListenerWithOptions(document, wheelEvent, unveil, {
|
||||
capture: true,
|
||||
passive: true
|
||||
});
|
||||
removeEventListenerWithOptions(window, 'resize', unveil, {
|
||||
capture: true,
|
||||
passive: true
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -196,11 +216,14 @@ define(['visibleinviewport', 'imageFetcher', 'layoutManager', 'events', 'browser
|
|||
}, 1);
|
||||
}
|
||||
|
||||
addEventListenerWithOptions(document, 'focus', unveil, {
|
||||
capture: true,
|
||||
passive: true
|
||||
});
|
||||
addEventListenerWithOptions(document, 'scroll', unveil, {
|
||||
capture: true,
|
||||
passive: true
|
||||
});
|
||||
document.addEventListener('focus', unveil, true);
|
||||
addEventListenerWithOptions(document, wheelEvent, unveil, {
|
||||
capture: true,
|
||||
passive: true
|
||||
|
|
|
@ -1,5 +1,31 @@
|
|||
define(['browser', 'layoutManager', 'scrollStyles'], function (browser, layoutManager) {
|
||||
|
||||
var supportsCaptureOption = false;
|
||||
try {
|
||||
var opts = Object.defineProperty({}, 'capture', {
|
||||
get: function () {
|
||||
supportsCaptureOption = true;
|
||||
}
|
||||
});
|
||||
window.addEventListener("test", null, opts);
|
||||
} catch (e) { }
|
||||
|
||||
function addEventListenerWithOptions(target, type, handler, options) {
|
||||
var optionsOrCapture = options;
|
||||
if (!supportsCaptureOption) {
|
||||
optionsOrCapture = options.capture;
|
||||
}
|
||||
target.addEventListener(type, handler, optionsOrCapture);
|
||||
}
|
||||
|
||||
function removeEventListenerWithOptions(target, type, handler, options) {
|
||||
var optionsOrCapture = options;
|
||||
if (!supportsCaptureOption) {
|
||||
optionsOrCapture = options.capture;
|
||||
}
|
||||
target.removeEventListener(type, handler, optionsOrCapture);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return type of the value.
|
||||
*
|
||||
|
@ -900,6 +926,12 @@ define(['browser', 'layoutManager', 'scrollStyles'], function (browser, layoutMa
|
|||
self.destroy = function () {
|
||||
|
||||
window.removeEventListener('resize', onResize, true);
|
||||
|
||||
// Reset native FRAME element scroll
|
||||
removeEventListenerWithOptions(frameElement, 'scroll', resetScroll, {
|
||||
passive: true
|
||||
});
|
||||
|
||||
scrollSource.removeEventListener(wheelEvent, scrollHandler);
|
||||
|
||||
// Reset initialized status and return the instance
|
||||
|
@ -911,6 +943,14 @@ define(['browser', 'layoutManager', 'scrollStyles'], function (browser, layoutMa
|
|||
load(false);
|
||||
}
|
||||
|
||||
function resetScroll() {
|
||||
if (o.horizontal) {
|
||||
this.scrollLeft = 0;
|
||||
} else {
|
||||
this.scrollTop = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize.
|
||||
*
|
||||
|
@ -954,11 +994,17 @@ define(['browser', 'layoutManager', 'scrollStyles'], function (browser, layoutMa
|
|||
scrollSource.addEventListener(wheelEvent, scrollHandler);
|
||||
|
||||
if (transform) {
|
||||
dragInitEventNames.forEach(function(eventName) {
|
||||
dragInitEventNames.forEach(function (eventName) {
|
||||
dragSourceElement.addEventListener(eventName, dragInitSlidee);
|
||||
});
|
||||
|
||||
window.addEventListener('resize', onResize, true);
|
||||
|
||||
if (!o.horizontal) {
|
||||
addEventListenerWithOptions(frameElement, 'scroll', resetScroll, {
|
||||
passive: true
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Mark instance as initialized
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue