mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
remove autosave and update variable declerations
This commit is contained in:
parent
8af1142000
commit
df2af2a6ef
4 changed files with 20 additions and 41 deletions
|
@ -14,10 +14,10 @@ import autoFocuser from 'autoFocuser';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var settingsInstance;
|
let settingsInstance;
|
||||||
var hasChanges;
|
let hasChanges;
|
||||||
var userId = params.userId || ApiClient.getCurrentUserId();
|
const userId = params.userId || ApiClient.getCurrentUserId();
|
||||||
var currentSettings = userId === ApiClient.getCurrentUserId() ? userSettings : new UserSettings();
|
const currentSettings = userId === ApiClient.getCurrentUserId() ? userSettings : new UserSettings();
|
||||||
view.addEventListener('viewshow', function () {
|
view.addEventListener('viewshow', function () {
|
||||||
window.addEventListener('beforeunload', onBeforeUnload);
|
window.addEventListener('beforeunload', onBeforeUnload);
|
||||||
|
|
||||||
|
@ -35,17 +35,11 @@ import autoFocuser from 'autoFocuser';
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
view.addEventListener('change', function () {
|
view.addEventListener('change', function () {
|
||||||
hasChanges = true;
|
hasChanges = true;
|
||||||
});
|
});
|
||||||
view.addEventListener('viewbeforehide', function () {
|
|
||||||
window.removeEventListener('beforeunload', onBeforeUnload);
|
|
||||||
hasChanges = false;
|
|
||||||
|
|
||||||
if (settingsInstance) {
|
|
||||||
settingsInstance.submit();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
view.addEventListener('viewdestroy', function () {
|
view.addEventListener('viewdestroy', function () {
|
||||||
if (settingsInstance) {
|
if (settingsInstance) {
|
||||||
settingsInstance.destroy();
|
settingsInstance.destroy();
|
||||||
|
|
|
@ -18,10 +18,10 @@ import 'listViewStyle';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var homescreenSettingsInstance;
|
let homescreenSettingsInstance;
|
||||||
var hasChanges;
|
let hasChanges;
|
||||||
var userId = params.userId || ApiClient.getCurrentUserId();
|
const userId = params.userId || ApiClient.getCurrentUserId();
|
||||||
var currentSettings = userId === ApiClient.getCurrentUserId() ? userSettings : new UserSettings();
|
const currentSettings = userId === ApiClient.getCurrentUserId() ? userSettings : new UserSettings();
|
||||||
view.addEventListener('viewshow', function () {
|
view.addEventListener('viewshow', function () {
|
||||||
window.addEventListener('beforeunload', onBeforeUnload);
|
window.addEventListener('beforeunload', onBeforeUnload);
|
||||||
|
|
||||||
|
@ -39,16 +39,11 @@ import 'listViewStyle';
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
view.addEventListener('change', function () {
|
view.addEventListener('change', function () {
|
||||||
hasChanges = true;
|
hasChanges = true;
|
||||||
});
|
});
|
||||||
view.addEventListener('viewbeforehide', function () {
|
|
||||||
hasChanges = false;
|
|
||||||
|
|
||||||
if (homescreenSettingsInstance) {
|
|
||||||
homescreenSettingsInstance.submit();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
view.addEventListener('viewdestroy', function () {
|
view.addEventListener('viewdestroy', function () {
|
||||||
if (homescreenSettingsInstance) {
|
if (homescreenSettingsInstance) {
|
||||||
homescreenSettingsInstance.destroy();
|
homescreenSettingsInstance.destroy();
|
||||||
|
|
|
@ -18,10 +18,10 @@ import 'listViewStyle';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var settingsInstance;
|
let settingsInstance;
|
||||||
var hasChanges;
|
let hasChanges;
|
||||||
var userId = params.userId || ApiClient.getCurrentUserId();
|
const userId = params.userId || ApiClient.getCurrentUserId();
|
||||||
var currentSettings = userId === ApiClient.getCurrentUserId() ? userSettings : new UserSettings();
|
const currentSettings = userId === ApiClient.getCurrentUserId() ? userSettings : new UserSettings();
|
||||||
view.addEventListener('viewshow', function () {
|
view.addEventListener('viewshow', function () {
|
||||||
window.addEventListener('beforeunload', onBeforeUnload);
|
window.addEventListener('beforeunload', onBeforeUnload);
|
||||||
|
|
||||||
|
@ -39,16 +39,11 @@ import 'listViewStyle';
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
view.addEventListener('change', function () {
|
view.addEventListener('change', function () {
|
||||||
hasChanges = true;
|
hasChanges = true;
|
||||||
});
|
});
|
||||||
view.addEventListener('viewbeforehide', function () {
|
|
||||||
hasChanges = false;
|
|
||||||
|
|
||||||
if (settingsInstance) {
|
|
||||||
settingsInstance.submit();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
view.addEventListener('viewdestroy', function () {
|
view.addEventListener('viewdestroy', function () {
|
||||||
if (settingsInstance) {
|
if (settingsInstance) {
|
||||||
settingsInstance.destroy();
|
settingsInstance.destroy();
|
||||||
|
|
|
@ -14,10 +14,10 @@ import autoFocuser from 'autoFocuser';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var subtitleSettingsInstance;
|
let subtitleSettingsInstance;
|
||||||
var hasChanges;
|
let hasChanges;
|
||||||
var userId = params.userId || ApiClient.getCurrentUserId();
|
const userId = params.userId || ApiClient.getCurrentUserId();
|
||||||
var currentSettings = userId === ApiClient.getCurrentUserId() ? userSettings : new UserSettings();
|
const currentSettings = userId === ApiClient.getCurrentUserId() ? userSettings : new UserSettings();
|
||||||
view.addEventListener('viewshow', function () {
|
view.addEventListener('viewshow', function () {
|
||||||
window.addEventListener('beforeunload', onBeforeUnload);
|
window.addEventListener('beforeunload', onBeforeUnload);
|
||||||
|
|
||||||
|
@ -35,16 +35,11 @@ import autoFocuser from 'autoFocuser';
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
view.addEventListener('change', function () {
|
view.addEventListener('change', function () {
|
||||||
hasChanges = true;
|
hasChanges = true;
|
||||||
});
|
});
|
||||||
view.addEventListener('viewbeforehide', function () {
|
|
||||||
hasChanges = false;
|
|
||||||
|
|
||||||
if (subtitleSettingsInstance) {
|
|
||||||
subtitleSettingsInstance.submit();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
view.addEventListener('viewdestroy', function () {
|
view.addEventListener('viewdestroy', function () {
|
||||||
if (subtitleSettingsInstance) {
|
if (subtitleSettingsInstance) {
|
||||||
subtitleSettingsInstance.destroy();
|
subtitleSettingsInstance.destroy();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue