mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Migrate site.js to ES6
This commit is contained in:
parent
e558ef80d7
commit
1a635e2f81
6 changed files with 235 additions and 512 deletions
|
@ -33,4 +33,4 @@ class appFooter {
|
|||
}
|
||||
}
|
||||
|
||||
export default appFooter;
|
||||
export default new appFooter({});
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import browser from 'browser';
|
||||
import appSettings from 'appSettings';
|
||||
import appHost from './apphost';
|
||||
import browser from '../scripts/browser';
|
||||
import { set, get } from '../scripts/settings/appSettings';
|
||||
import events from 'events';
|
||||
|
||||
function setLayout(instance, layout, selectedLayout) {
|
||||
|
@ -18,7 +19,7 @@ class LayoutManager {
|
|||
this.autoLayout();
|
||||
|
||||
if (save !== false) {
|
||||
appSettings.set('layout', '');
|
||||
set('layout', '');
|
||||
}
|
||||
} else {
|
||||
setLayout(this, 'mobile', layout);
|
||||
|
@ -26,15 +27,15 @@ class LayoutManager {
|
|||
setLayout(this, 'desktop', layout);
|
||||
|
||||
if (save !== false) {
|
||||
appSettings.set('layout', layout);
|
||||
set('layout', layout);
|
||||
}
|
||||
}
|
||||
|
||||
events.trigger(this, 'modechange');
|
||||
}
|
||||
|
||||
getSavedLayout(layout) {
|
||||
return appSettings.get('layout');
|
||||
getSavedLayout() {
|
||||
return get('layout');
|
||||
}
|
||||
|
||||
autoLayout() {
|
||||
|
@ -58,4 +59,12 @@ class LayoutManager {
|
|||
}
|
||||
}
|
||||
|
||||
export default new LayoutManager();
|
||||
const layoutManager = new LayoutManager();
|
||||
|
||||
if (appHost.getDefaultLayout) {
|
||||
layoutManager.defaultLayout = appHost.getDefaultLayout();
|
||||
}
|
||||
|
||||
layoutManager.init();
|
||||
|
||||
export default layoutManager;
|
||||
|
|
|
@ -256,7 +256,7 @@ import 'emby-ratingbutton';
|
|||
|
||||
return new Promise(function (resolve, reject) {
|
||||
Promise.all([
|
||||
import('appFooter-shared'),
|
||||
import('appFooter'),
|
||||
import('itemShortcuts'),
|
||||
import('css!./nowPlayingBar.css'),
|
||||
import('emby-slider')
|
||||
|
|
|
@ -3757,4 +3757,14 @@ class PlaybackManager {
|
|||
}
|
||||
}
|
||||
|
||||
export default new PlaybackManager();
|
||||
const playbackManager = new PlayQueueManager();
|
||||
|
||||
window.addEventListener('beforeunload', function () {
|
||||
try {
|
||||
playbackManager.onAppClose();
|
||||
} catch (err) {
|
||||
console.error('error in onAppClose: ' + err);
|
||||
}
|
||||
});
|
||||
|
||||
export default playbackManager;
|
||||
|
|
|
@ -169,4 +169,7 @@ class ViewManager {
|
|||
}
|
||||
}
|
||||
|
||||
export default new ViewManager();
|
||||
const viewManager = new ViewManager();
|
||||
viewManager.default.dispatchPageEvents(true);
|
||||
|
||||
export default viewManager;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue