mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update search
This commit is contained in:
parent
036319e68b
commit
0f0c5850a8
3 changed files with 50 additions and 9 deletions
|
@ -214,7 +214,9 @@ define(['browser'], function (browser) {
|
|||
|
||||
if (enableAnimation() && oldAnimatedPage && newAnimatedPage.animate) {
|
||||
if (transition == 'slide') {
|
||||
return slide(newAnimatedPage, oldAnimatedPage, transition, isBack);
|
||||
return slideLeft(newAnimatedPage, oldAnimatedPage, transition, isBack);
|
||||
} else if (transition == 'slidedown') {
|
||||
return slideDown(newAnimatedPage, oldAnimatedPage, transition, isBack);
|
||||
} else if (transition == 'fade') {
|
||||
return fade(newAnimatedPage, oldAnimatedPage, transition, isBack);
|
||||
}
|
||||
|
@ -223,7 +225,7 @@ define(['browser'], function (browser) {
|
|||
return Promise.resolve();
|
||||
}
|
||||
|
||||
function slide(newAnimatedPage, oldAnimatedPage, transition, isBack) {
|
||||
function slideLeft(newAnimatedPage, oldAnimatedPage, transition, isBack) {
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
|
@ -266,13 +268,56 @@ define(['browser'], function (browser) {
|
|||
});
|
||||
}
|
||||
|
||||
function slideDown(newAnimatedPage, oldAnimatedPage, transition, isBack) {
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
// Do not use fill: both or the ability to swipe horizontally may be affected on Chrome 50
|
||||
var timings = {
|
||||
duration: 450,
|
||||
iterations: 1,
|
||||
easing: 'ease-out'
|
||||
}
|
||||
|
||||
if (!browser.chrome) {
|
||||
timings.fill = 'both';
|
||||
}
|
||||
|
||||
var animations = [];
|
||||
|
||||
if (oldAnimatedPage) {
|
||||
var destination = isBack ? '100%' : '-100%';
|
||||
|
||||
animations.push(oldAnimatedPage.animate([
|
||||
|
||||
{ transform: 'none', offset: 0 },
|
||||
{ transform: 'translate3d(' + destination + ', 0, 0)', offset: 1 }
|
||||
|
||||
], timings));
|
||||
}
|
||||
|
||||
var start = isBack ? '100%' : '-100%';
|
||||
|
||||
animations.push(newAnimatedPage.animate([
|
||||
|
||||
{ transform: 'translate3d(0, ' + start + ', 0)', offset: 0 },
|
||||
{ transform: 'none', offset: 1 }
|
||||
|
||||
], timings));
|
||||
|
||||
currentAnimations = animations;
|
||||
|
||||
animations[animations.length - 1].onfinish = resolve;
|
||||
});
|
||||
}
|
||||
|
||||
function fade(newAnimatedPage, oldAnimatedPage, transition, isBack) {
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
// Do not use fill: both or the ability to swipe horizontally may be affected on Chrome 50
|
||||
var timings = {
|
||||
duration: 140,
|
||||
duration: 160,
|
||||
iterations: 1,
|
||||
easing: 'ease-out'
|
||||
}
|
||||
|
|
|
@ -176,10 +176,6 @@
|
|||
loadSuggestions(view);
|
||||
}
|
||||
|
||||
view.addEventListener('viewshow', function () {
|
||||
focusManager.focus(view.querySelector('.txtSearch'));
|
||||
});
|
||||
|
||||
view.querySelector('.txtSearch').addEventListener('input', function () {
|
||||
onSearchChange(this.value);
|
||||
});
|
||||
|
|
|
@ -2896,8 +2896,8 @@ var AppInfo = {};
|
|||
defineRoute({
|
||||
path: '/search.html',
|
||||
dependencies: [],
|
||||
autoFocus: false,
|
||||
controller: 'scripts/searchpage'
|
||||
controller: 'scripts/searchpage',
|
||||
transition: 'slidedown'
|
||||
});
|
||||
|
||||
defineRoute({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue