mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-18 03:18:19 -07:00
23677db990
This de-minifies and de-uglifies `controllers` subdirectory
37 lines
1.3 KiB
JavaScript
37 lines
1.3 KiB
JavaScript
define(["focusManager", "searchFields", "searchResults", "events"], function (focusManager, SearchFields, SearchResults, events) {
|
|
"use strict";
|
|
|
|
return function (view, params) {
|
|
function onSearch(e, value) {
|
|
self.searchResults.search(value);
|
|
}
|
|
|
|
var self = this;
|
|
view.addEventListener("viewshow", function () {
|
|
if (!self.searchFields) {
|
|
self.searchFields = new SearchFields({
|
|
element: view.querySelector(".searchFields")
|
|
});
|
|
self.searchResults = new SearchResults({
|
|
element: view.querySelector(".searchResults"),
|
|
serverId: params.serverId || ApiClient.serverId(),
|
|
parentId: params.parentId,
|
|
collectionType: params.collectionType
|
|
});
|
|
events.on(self.searchFields, "search", onSearch);
|
|
}
|
|
});
|
|
view.addEventListener("viewdestroy", function () {
|
|
if (self.searchFields) {
|
|
self.searchFields.destroy();
|
|
self.searchFields = null;
|
|
}
|
|
|
|
if (self.searchResults) {
|
|
self.searchResults.destroy();
|
|
self.searchResults = null;
|
|
}
|
|
});
|
|
};
|
|
});
|