mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update now playing bar
This commit is contained in:
parent
7dbc6ede62
commit
8ba393c549
13 changed files with 101 additions and 123 deletions
|
@ -75,7 +75,6 @@
|
|||
return html;
|
||||
}
|
||||
|
||||
var translateY = '-64px';
|
||||
function slideDown(elem) {
|
||||
|
||||
if (elem.classList.contains('hide')) {
|
||||
|
@ -93,8 +92,8 @@
|
|||
|
||||
requestAnimationFrame(function () {
|
||||
var keyframes = [
|
||||
{ transform: 'translateY(' + translateY + ')', offset: 0 },
|
||||
{ transform: 'none', offset: 1 }];
|
||||
{ transform: 'none', offset: 0 },
|
||||
{ transform: 'translateY(100%)', offset: 1 }];
|
||||
var timing = { duration: 200, iterations: 1, fill: 'both', easing: 'ease-out' };
|
||||
elem.animate(keyframes, timing).onfinish = onfinish;
|
||||
});
|
||||
|
@ -115,8 +114,8 @@
|
|||
requestAnimationFrame(function () {
|
||||
|
||||
var keyframes = [
|
||||
{ transform: 'none', offset: 0 },
|
||||
{ transform: 'translateY(' + translateY + ')', offset: 1 }];
|
||||
{ transform: 'translateY(100%)', offset: 0 },
|
||||
{ transform: 'none', offset: 1 }];
|
||||
var timing = { duration: 200, iterations: 1, fill: 'both', easing: 'ease-out' };
|
||||
elem.animate(keyframes, timing);
|
||||
});
|
||||
|
@ -308,17 +307,18 @@
|
|||
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
require(['itemShortcuts', 'css!css/nowplayingbar.css', 'emby-slider'], function (itemShortcuts) {
|
||||
require(['appfooter-shared', 'itemShortcuts', 'css!css/nowplayingbar.css', 'emby-slider'], function (appfooter, itemShortcuts) {
|
||||
|
||||
nowPlayingBarElement = document.querySelector('.nowPlayingBar');
|
||||
var parentContainer = appfooter.element;
|
||||
nowPlayingBarElement = parentContainer.querySelector('.nowPlayingBar');
|
||||
|
||||
if (nowPlayingBarElement) {
|
||||
resolve(nowPlayingBarElement);
|
||||
return;
|
||||
}
|
||||
|
||||
document.body.insertAdjacentHTML('beforeend', getNowPlayingBarHtml());
|
||||
nowPlayingBarElement = document.querySelector('.nowPlayingBar');
|
||||
parentContainer.insertAdjacentHTML('beforeend', getNowPlayingBarHtml());
|
||||
nowPlayingBarElement = parentContainer.querySelector('.nowPlayingBar');
|
||||
|
||||
if (browser.safari && browser.slow) {
|
||||
// Not handled well here. The wrong elements receive events, bar doesn't update quickly enough, etc.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue