jellyfin-web/dashboard-ui/scripts/searchtab.js

1 line
1.1 KiB
JavaScript
Raw Normal View History

2017-05-02 11:21:14 -07:00
define(["searchFields","searchResults","events"],function(SearchFields,SearchResults,events){"use strict";function init(instance,tabContent,parentId){tabContent.innerHTML='<div class="padded-left padded-right searchFields"></div><div class="searchResults padded-top" style="padding-top:1.5em;"></div>',instance.searchFields=new SearchFields({element:tabContent.querySelector(".searchFields")}),instance.searchResults=new SearchResults({element:tabContent.querySelector(".searchResults"),serverId:ApiClient.serverId(),parentId:parentId}),events.on(instance.searchFields,"search",function(e,value){instance.searchResults.search(value)})}function SearchTab(view,params,tabContent){var self=this;init(this,tabContent,params.topParentId||params.parentId),self.preRender=function(){},self.renderTab=function(){var searchFields=this.searchFields;searchFields&&searchFields.focus()}}return SearchTab.prototype.destroy=function(){var searchFields=this.searchFields;searchFields&&searchFields.destroy(),this.searchFields=null;var searchResults=this.searchResults;searchResults&&searchResults.destroy(),this.searchResults=null},SearchTab});