mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Deminify part 2 (#509)
This de-minifies and de-uglifies `controllers` subdirectory
This commit is contained in:
parent
f98a43f06f
commit
23677db990
66 changed files with 8296 additions and 4227 deletions
|
@ -1,35 +1,74 @@
|
|||
define(["userSettings", "loading", "connectionManager", "apphost", "layoutManager", "focusManager", "homeSections", "emby-itemscontainer"], function(userSettings, loading, connectionManager, appHost, layoutManager, focusManager, homeSections) {
|
||||
define(["userSettings", "loading", "connectionManager", "apphost", "layoutManager", "focusManager", "homeSections", "emby-itemscontainer"], function (userSettings, loading, connectionManager, appHost, layoutManager, focusManager, homeSections) {
|
||||
"use strict";
|
||||
|
||||
function HomeTab(view, params) {
|
||||
this.view = view, this.params = params, this.apiClient = connectionManager.currentApiClient(), this.sectionsContainer = view.querySelector(".sections"), view.querySelector(".sections").addEventListener("settingschange", onHomeScreenSettingsChanged.bind(this))
|
||||
this.view = view;
|
||||
this.params = params;
|
||||
this.apiClient = connectionManager.currentApiClient();
|
||||
this.sectionsContainer = view.querySelector(".sections");
|
||||
view.querySelector(".sections").addEventListener("settingschange", onHomeScreenSettingsChanged.bind(this));
|
||||
}
|
||||
|
||||
function onHomeScreenSettingsChanged() {
|
||||
this.sectionsRendered = !1, this.paused || this.onResume({
|
||||
refresh: !0
|
||||
})
|
||||
this.sectionsRendered = false;
|
||||
|
||||
if (!this.paused) {
|
||||
this.onResume({
|
||||
refresh: true
|
||||
});
|
||||
}
|
||||
}
|
||||
return HomeTab.prototype.onResume = function(options) {
|
||||
|
||||
HomeTab.prototype.onResume = function (options) {
|
||||
if (this.sectionsRendered) {
|
||||
var sectionsContainer = this.sectionsContainer;
|
||||
return sectionsContainer ? homeSections.resume(sectionsContainer, options) : Promise.resolve()
|
||||
|
||||
if (sectionsContainer) {
|
||||
return homeSections.resume(sectionsContainer, options);
|
||||
}
|
||||
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
loading.show();
|
||||
var view = this.view,
|
||||
apiClient = this.apiClient;
|
||||
return this.destroyHomeSections(), this.sectionsRendered = !0, apiClient.getCurrentUser().then(function(user) {
|
||||
return homeSections.loadSections(view.querySelector(".sections"), apiClient, user, userSettings).then(function() {
|
||||
options.autoFocus && focusManager.autoFocus(view), loading.hide()
|
||||
})
|
||||
})
|
||||
}, HomeTab.prototype.onPause = function() {
|
||||
var view = this.view;
|
||||
var apiClient = this.apiClient;
|
||||
this.destroyHomeSections();
|
||||
this.sectionsRendered = true;
|
||||
return apiClient.getCurrentUser().then(function (user) {
|
||||
return homeSections.loadSections(view.querySelector(".sections"), apiClient, user, userSettings).then(function () {
|
||||
if (options.autoFocus) {
|
||||
focusManager.autoFocus(view);
|
||||
}
|
||||
|
||||
loading.hide();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
HomeTab.prototype.onPause = function () {
|
||||
var sectionsContainer = this.sectionsContainer;
|
||||
sectionsContainer && homeSections.pause(sectionsContainer)
|
||||
}, HomeTab.prototype.destroy = function() {
|
||||
this.view = null, this.params = null, this.apiClient = null, this.destroyHomeSections(), this.sectionsContainer = null
|
||||
}, HomeTab.prototype.destroyHomeSections = function() {
|
||||
|
||||
if (sectionsContainer) {
|
||||
homeSections.pause(sectionsContainer);
|
||||
}
|
||||
};
|
||||
|
||||
HomeTab.prototype.destroy = function () {
|
||||
this.view = null;
|
||||
this.params = null;
|
||||
this.apiClient = null;
|
||||
this.destroyHomeSections();
|
||||
this.sectionsContainer = null;
|
||||
};
|
||||
|
||||
HomeTab.prototype.destroyHomeSections = function () {
|
||||
var sectionsContainer = this.sectionsContainer;
|
||||
sectionsContainer && homeSections.destroySections(sectionsContainer)
|
||||
}, HomeTab
|
||||
});
|
||||
|
||||
if (sectionsContainer) {
|
||||
homeSections.destroySections(sectionsContainer);
|
||||
}
|
||||
};
|
||||
|
||||
return HomeTab;
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue