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

update search animation

This commit is contained in:
Luke Pulverenti 2015-11-17 11:36:48 -05:00
parent b99edc598d
commit 8d0251b825
3 changed files with 27 additions and 40 deletions

View file

@ -11,20 +11,24 @@
require(["jquery", "velocity"], function ($, Velocity) {
$('.btnCloseSearch').hide();
var elem = $('.viewMenuSearch')
.css({ left: '100%' })
.removeClass('hide')[0];
var elem = $('.viewMenuSearch').removeClass('hide')[0];
Velocity.animate(elem, { "left": "0px" },
{
complete: function () {
$('.headerSearchInput').focus();
$('.btnCloseSearch').show();
}
});
fadeIn(elem, 1).onfinish = function () {
$('.headerSearchInput').focus();
$('.btnCloseSearch').show();
};
});
};
function fadeIn(elem, iterations) {
var keyframes = [
{ opacity: '0', offset: 0 },
{ opacity: '1', offset: 1 }];
var timing = { duration: 200, iterations: iterations };
return elem.animate(keyframes, timing);
}
self.hide = function () {
var viewMenuSearch = document.querySelector('.viewMenuSearch');
@ -34,18 +38,8 @@
}
if (!viewMenuSearch.classList.contains('hide')) {
require(["jquery", "velocity"], function ($, Velocity) {
$('.btnCloseSearch').hide();
viewMenuSearch.style.left = '0';
Velocity.animate(viewMenuSearch, { "left": "100%" },
{
complete: function () {
$('.viewMenuSearch').visible(false);
}
});
});
$('.btnCloseSearch').hide();
viewMenuSearch.classList.add('hide');
}
};