mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
merge from dev
This commit is contained in:
parent
1c8f02ce0f
commit
33b01d778c
911 changed files with 34157 additions and 57125 deletions
|
@ -111,14 +111,14 @@
|
|||
searchTerm: searchTerm,
|
||||
limit: 30
|
||||
|
||||
}).done(function (result) {
|
||||
}).then(function (result) {
|
||||
|
||||
if (currentTimeout == searchHintTimeout) {
|
||||
renderSearchResultsInOverlay(elem, result.SearchHints);
|
||||
}
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
}).fail(function () {
|
||||
}, function () {
|
||||
Dashboard.hideLoadingMsg();
|
||||
});
|
||||
}
|
||||
|
@ -151,13 +151,15 @@
|
|||
|
||||
html += '<div class="searchResultsContainer"><div class="itemsContainer"></div></div></div>';
|
||||
|
||||
elem = $(html).appendTo(document.body).hide()[0];
|
||||
elem = $(html).appendTo(document.body)[0];
|
||||
$(elem).createCardMenus();
|
||||
}
|
||||
|
||||
return elem;
|
||||
}
|
||||
|
||||
var isVisible;
|
||||
|
||||
function onHeaderSearchChange(val) {
|
||||
|
||||
var elem;
|
||||
|
@ -166,8 +168,11 @@
|
|||
|
||||
elem = getSearchOverlay(true);
|
||||
|
||||
$(elem).show();
|
||||
elem.style.opacity = '1';
|
||||
if (!isVisible) {
|
||||
fadeIn(elem, 1);
|
||||
}
|
||||
isVisible = true;
|
||||
|
||||
document.body.classList.add('bodyWithPopupOpen');
|
||||
|
||||
updateSearchOverlay(elem, val);
|
||||
|
@ -176,16 +181,36 @@
|
|||
elem = getSearchOverlay(false);
|
||||
|
||||
if (elem) {
|
||||
require(["jquery", "velocity"], function ($, Velocity) {
|
||||
|
||||
$(elem).velocity("fadeOut");
|
||||
document.body.classList.remove('bodyWithPopupOpen');
|
||||
});
|
||||
updateSearchOverlay(elem, '');
|
||||
|
||||
if (isVisible) {
|
||||
fadeOut(elem, 1);
|
||||
isVisible = false;
|
||||
}
|
||||
document.body.classList.remove('bodyWithPopupOpen');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function fadeIn(elem, iterations) {
|
||||
|
||||
var keyframes = [
|
||||
{ opacity: '0', offset: 0 },
|
||||
{ opacity: '1', offset: 1 }];
|
||||
var timing = { duration: 200, iterations: iterations, fill: 'both' };
|
||||
elem.animate(keyframes, timing);
|
||||
}
|
||||
|
||||
function fadeOut(elem, iterations) {
|
||||
var keyframes = [
|
||||
{ opacity: '1', offset: 0 },
|
||||
{ opacity: '0', offset: 1 }];
|
||||
var timing = { duration: 600, iterations: iterations, fill: 'both' };
|
||||
elem.animate(keyframes, timing).onfinish = function () {
|
||||
elem.parentNode.removeChild(elem);
|
||||
};
|
||||
}
|
||||
|
||||
function bindSearchEvents() {
|
||||
|
||||
require(['searchmenu'], function () {
|
||||
|
@ -215,9 +240,9 @@
|
|||
});
|
||||
}
|
||||
|
||||
$(document).on('pagecontainerbeforehide', closeSearchResults);
|
||||
document.addEventListener('pagebeforehide', closeSearchResults);
|
||||
|
||||
$(document).on('headercreated', function () {
|
||||
document.addEventListener('headercreated', function () {
|
||||
|
||||
bindSearchEvents();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue