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) {
|
define(['browser'], function (browser) {
|
||||||
|
|
||||||
var allPages = document.querySelectorAll('.mainAnimatedPage');
|
var allPages = document.querySelectorAll('.mainAnimatedPage');
|
||||||
|
var currentUrls = [];
|
||||||
var pageContainerCount = allPages.length;
|
var pageContainerCount = allPages.length;
|
||||||
var animationDuration = 500;
|
var animationDuration = 500;
|
||||||
var allowAnimation = true;
|
var allowAnimation = true;
|
||||||
|
@ -98,6 +99,7 @@ define(['browser'], function (browser) {
|
||||||
animate(animatable, previousAnimatable, options.transition, options.isBack).then(function () {
|
animate(animatable, previousAnimatable, options.transition, options.isBack).then(function () {
|
||||||
|
|
||||||
selectedPageIndex = pageIndex;
|
selectedPageIndex = pageIndex;
|
||||||
|
currentUrls[pageIndex] = options.url;
|
||||||
if (!options.cancel && previousAnimatable) {
|
if (!options.cancel && previousAnimatable) {
|
||||||
afterAnimate(allPages, pageIndex);
|
afterAnimate(allPages, pageIndex);
|
||||||
}
|
}
|
||||||
|
@ -147,7 +149,7 @@ define(['browser'], function (browser) {
|
||||||
function normalizeNewView(options) {
|
function normalizeNewView(options) {
|
||||||
|
|
||||||
if (options.view.indexOf('data-role="page"') == -1) {
|
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 += options.view;
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
return html;
|
return html;
|
||||||
|
@ -158,7 +160,7 @@ define(['browser'], function (browser) {
|
||||||
var elem = parseHtml(options.view, hasScript);
|
var elem = parseHtml(options.view, hasScript);
|
||||||
elem.classList.add('page-view');
|
elem.classList.add('page-view');
|
||||||
elem.setAttribute('data-type', options.type || '');
|
elem.setAttribute('data-type', options.type || '');
|
||||||
elem.setAttribute('data-url', options.url);
|
|
||||||
return {
|
return {
|
||||||
elem: elem,
|
elem: elem,
|
||||||
hasScript: hasScript
|
hasScript: hasScript
|
||||||
|
@ -321,21 +323,13 @@ define(['browser'], function (browser) {
|
||||||
function tryRestoreView(options) {
|
function tryRestoreView(options) {
|
||||||
|
|
||||||
var url = options.url;
|
var url = options.url;
|
||||||
var view = document.querySelector(".page-view[data-url='" + url + "']");
|
var index = currentUrls.indexOf(url);
|
||||||
var page = parentWithClass(view, 'mainAnimatedPage');
|
|
||||||
|
|
||||||
if (view) {
|
if (index != -1) {
|
||||||
|
var page = allPages[index];
|
||||||
|
var view = page.querySelector(".page-view");
|
||||||
|
|
||||||
var index = -1;
|
if (view) {
|
||||||
var pages = allPages;
|
|
||||||
for (var i = 0, length = pages.length; i < length; i++) {
|
|
||||||
if (pages[i] == page) {
|
|
||||||
index = i;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (index != -1) {
|
|
||||||
|
|
||||||
if (options.cancel) {
|
if (options.cancel) {
|
||||||
return;
|
return;
|
||||||
|
@ -377,14 +371,7 @@ define(['browser'], function (browser) {
|
||||||
|
|
||||||
function reset() {
|
function reset() {
|
||||||
|
|
||||||
var views = document.querySelectorAll(".mainAnimatedPage.hide .page-view");
|
currentUrls = [];
|
||||||
|
|
||||||
for (var i = 0, length = views.length; i < length; i++) {
|
|
||||||
|
|
||||||
var view = views[i];
|
|
||||||
triggerDestroy(view);
|
|
||||||
view.parentNode.removeChild(view);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function parentWithClass(elem, className) {
|
function parentWithClass(elem, className) {
|
||||||
|
|
|
@ -10,9 +10,9 @@
|
||||||
font-weight: bold !important;
|
font-weight: bold !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*.libraryViewNav {
|
.libraryViewNav {
|
||||||
box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.2);
|
box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.2);
|
||||||
}*/
|
}
|
||||||
|
|
||||||
@media all and (min-width: 300px) {
|
@media all and (min-width: 300px) {
|
||||||
|
|
||||||
|
|
|
@ -1166,7 +1166,7 @@ var Dashboard = {
|
||||||
// The native app can handle a little bit more than safari
|
// The native app can handle a little bit more than safari
|
||||||
if (AppInfo.isNativeApp) {
|
if (AppInfo.isNativeApp) {
|
||||||
|
|
||||||
quality -= 10;
|
quality -= 5;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
@ -1183,11 +1183,6 @@ var Dashboard = {
|
||||||
|
|
||||||
options.enableImageEnhancers = false;
|
options.enableImageEnhancers = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AppInfo.forcedImageFormat && options.type != 'Logo') {
|
|
||||||
options.format = AppInfo.forcedImageFormat;
|
|
||||||
options.backgroundColor = '#1c1c1c';
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
loadExternalPlayer: function () {
|
loadExternalPlayer: function () {
|
||||||
|
@ -1472,8 +1467,6 @@ var AppInfo = {};
|
||||||
AppInfo.enableDetailPageChapters = false;
|
AppInfo.enableDetailPageChapters = false;
|
||||||
AppInfo.enableDetailsMenuImages = false;
|
AppInfo.enableDetailsMenuImages = false;
|
||||||
AppInfo.enableMovieHomeSuggestions = 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) {
|
function setDocumentClasses(browser) {
|
||||||
|
|
||||||
var elem = document.documentElement;
|
var elem = document.documentElement;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue