mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update viewcontainer-lite.js
This commit is contained in:
parent
24662bdf6d
commit
f00fc6ad15
3 changed files with 13 additions and 66 deletions
|
@ -1,6 +1,7 @@
|
|||
define(['browser'], function (browser) {
|
||||
|
||||
var allPages = document.querySelectorAll('.mainAnimatedPage');
|
||||
var currentUrls = [];
|
||||
var pageContainerCount = allPages.length;
|
||||
var animationDuration = 500;
|
||||
var allowAnimation = true;
|
||||
|
@ -98,6 +99,7 @@ define(['browser'], function (browser) {
|
|||
animate(animatable, previousAnimatable, options.transition, options.isBack).then(function () {
|
||||
|
||||
selectedPageIndex = pageIndex;
|
||||
currentUrls[pageIndex] = options.url;
|
||||
if (!options.cancel && previousAnimatable) {
|
||||
afterAnimate(allPages, pageIndex);
|
||||
}
|
||||
|
@ -147,7 +149,7 @@ define(['browser'], function (browser) {
|
|||
function normalizeNewView(options) {
|
||||
|
||||
if (options.view.indexOf('data-role="page"') == -1) {
|
||||
var html = '<div class="page-view" data-type="' + (options.type || '') + '" data-url="' + options.url + '">';
|
||||
var html = '<div class="page-view" data-type="' + (options.type || '') + '">';
|
||||
html += options.view;
|
||||
html += '</div>';
|
||||
return html;
|
||||
|
@ -158,7 +160,7 @@ define(['browser'], function (browser) {
|
|||
var elem = parseHtml(options.view, hasScript);
|
||||
elem.classList.add('page-view');
|
||||
elem.setAttribute('data-type', options.type || '');
|
||||
elem.setAttribute('data-url', options.url);
|
||||
|
||||
return {
|
||||
elem: elem,
|
||||
hasScript: hasScript
|
||||
|
@ -321,21 +323,13 @@ define(['browser'], function (browser) {
|
|||
function tryRestoreView(options) {
|
||||
|
||||
var url = options.url;
|
||||
var view = document.querySelector(".page-view[data-url='" + url + "']");
|
||||
var page = parentWithClass(view, 'mainAnimatedPage');
|
||||
|
||||
if (view) {
|
||||
|
||||
var index = -1;
|
||||
var pages = allPages;
|
||||
for (var i = 0, length = pages.length; i < length; i++) {
|
||||
if (pages[i] == page) {
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
var index = currentUrls.indexOf(url);
|
||||
|
||||
if (index != -1) {
|
||||
var page = allPages[index];
|
||||
var view = page.querySelector(".page-view");
|
||||
|
||||
if (view) {
|
||||
|
||||
if (options.cancel) {
|
||||
return;
|
||||
|
@ -377,14 +371,7 @@ define(['browser'], function (browser) {
|
|||
|
||||
function reset() {
|
||||
|
||||
var views = document.querySelectorAll(".mainAnimatedPage.hide .page-view");
|
||||
|
||||
for (var i = 0, length = views.length; i < length; i++) {
|
||||
|
||||
var view = views[i];
|
||||
triggerDestroy(view);
|
||||
view.parentNode.removeChild(view);
|
||||
}
|
||||
currentUrls = [];
|
||||
}
|
||||
|
||||
function parentWithClass(elem, className) {
|
||||
|
|
|
@ -10,9 +10,9 @@
|
|||
font-weight: bold !important;
|
||||
}
|
||||
|
||||
/*.libraryViewNav {
|
||||
.libraryViewNav {
|
||||
box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.2);
|
||||
}*/
|
||||
}
|
||||
|
||||
@media all and (min-width: 300px) {
|
||||
|
||||
|
|
|
@ -1166,7 +1166,7 @@ var Dashboard = {
|
|||
// The native app can handle a little bit more than safari
|
||||
if (AppInfo.isNativeApp) {
|
||||
|
||||
quality -= 10;
|
||||
quality -= 5;
|
||||
|
||||
} else {
|
||||
|
||||
|
@ -1183,11 +1183,6 @@ var Dashboard = {
|
|||
|
||||
options.enableImageEnhancers = false;
|
||||
}
|
||||
|
||||
if (AppInfo.forcedImageFormat && options.type != 'Logo') {
|
||||
options.format = AppInfo.forcedImageFormat;
|
||||
options.backgroundColor = '#1c1c1c';
|
||||
}
|
||||
},
|
||||
|
||||
loadExternalPlayer: function () {
|
||||
|
@ -1472,8 +1467,6 @@ var AppInfo = {};
|
|||
AppInfo.enableDetailPageChapters = false;
|
||||
AppInfo.enableDetailsMenuImages = false;
|
||||
AppInfo.enableMovieHomeSuggestions = false;
|
||||
|
||||
AppInfo.forcedImageFormat = 'jpg';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1642,39 +1635,6 @@ var AppInfo = {};
|
|||
});
|
||||
}
|
||||
|
||||
function initFastClick() {
|
||||
|
||||
require(["fastclick"], function (FastClick) {
|
||||
|
||||
FastClick.attach(document.body, {
|
||||
tapDelay: 0
|
||||
});
|
||||
|
||||
function parentWithClass(elem, className) {
|
||||
|
||||
while (!elem.classList || !elem.classList.contains(className)) {
|
||||
elem = elem.parentNode;
|
||||
|
||||
if (!elem) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return elem;
|
||||
}
|
||||
|
||||
// Have to work around this issue of fast click breaking the panel dismiss
|
||||
document.body.addEventListener('touchstart', function (e) {
|
||||
|
||||
var tgt = parentWithClass(e.target, 'ui-panel-dismiss');
|
||||
if (tgt) {
|
||||
$(tgt).click();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function setDocumentClasses(browser) {
|
||||
|
||||
var elem = document.documentElement;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue