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

update dialogs

This commit is contained in:
Luke Pulverenti 2016-05-16 13:11:49 -04:00
parent f00fc6ad15
commit 3cc014002e
20 changed files with 71 additions and 90 deletions

View file

@ -13,6 +13,21 @@
return elem;
}
function fadeInRight(elem) {
var pct = browserInfo.mobile ? '2%' : '1%';
var keyframes = [
{ opacity: '0', transform: 'translate3d(' + pct + ', 0, 0)', offset: 0 },
{ opacity: '1', transform: 'none', offset: 1 }];
elem.animate(keyframes, {
duration: 300,
iterations: 1,
easing: 'ease-out'
});
}
var libraryBrowser = (function (window, document, screen) {
// Regular Expressions for parsing tags and attributes
@ -225,7 +240,7 @@
});
},
configurePaperLibraryTabs: function (ownerpage, tabs, panels, animate) {
configurePaperLibraryTabs: function (ownerpage, tabs, panels, animateTabs) {
if (!browserInfo.safari) {
LibraryBrowser.configureSwipeTabs(ownerpage, tabs);
@ -241,21 +256,6 @@
tabs.classList.add('hiddenScrollX');
function fadeInRight(elem) {
var pct = browserInfo.mobile ? '1.5%' : '0.5%';
var keyframes = [
{ opacity: '0', transform: 'translate3d(' + pct + ', 0, 0)', offset: 0 },
{ opacity: '1', transform: 'none', offset: 1 }];
elem.animate(keyframes, {
duration: 300,
iterations: 1,
easing: 'ease-out'
});
}
tabs.addEventListener('click', function (e) {
var current = tabs.querySelector('.is-active');
@ -267,24 +267,28 @@
current.classList.remove('is-active');
panels[parseInt(current.getAttribute('data-index'))].classList.remove('is-active');
}
link.classList.add('is-active');
var index = parseInt(link.getAttribute('data-index'));
tabs.dispatchEvent(new CustomEvent("tabchange", {
detail: {
selectedTabIndex: index
}
}));
var newPanel = panels[index];
panels[index].classList.add('is-active');
if (browserInfo.animate && animate) {
fadeInRight(panels[index]);
if (animateTabs && animateTabs.indexOf(index) != -1 && /*browserInfo.animate &&*/ newPanel.animate) {
fadeInRight(newPanel);
}
// If toCenter is called syncronously within the click event, it sometimes ends up canceling it
//setTimeout(function() {
// scrollHelper.toCenter(tabs, link, true);
//}, 10);
setTimeout(function () {
tabs.dispatchEvent(new CustomEvent("tabchange", {
detail: {
selectedTabIndex: index
}
}));
newPanel.classList.add('is-active');
//scrollHelper.toCenter(tabs, link, true);
}, 100);
}
});
@ -1722,7 +1726,7 @@
if (AppInfo.hasLowImageBandwidth) {
if (!AppInfo.isNativeApp) {
screenWidth *= .7;
screenWidth *= .75;
}
} else {
screenWidth *= 1.2;