migration of display, home, playback and subtitles to ES6 modules

This commit is contained in:
Cameron 2020-07-09 17:19:21 +01:00
parent 9f0dfb4756
commit 8af1142000
5 changed files with 56 additions and 28 deletions

View file

@ -1,10 +1,13 @@
define(['subtitleSettings', 'userSettings', 'autoFocuser'], function (SubtitleSettings, userSettings, autoFocuser) {
'use strict';
import SubtitleSettings from 'subtitleSettings';
import * as userSettings from 'userSettings';
import autoFocuser from 'autoFocuser';
/* eslint-disable indent */
// Shortcuts
const UserSettings = userSettings.UserSettings;
return function (view, params) {
export default function (view, params) {
function onBeforeUnload(e) {
if (hasChanges) {
e.returnValue = 'You currently have unsaved changes. Are you sure you wish to leave?';
@ -26,8 +29,8 @@ define(['subtitleSettings', 'userSettings', 'autoFocuser'], function (SubtitleSe
userId: userId,
element: view.querySelector('.settingsContainer'),
userSettings: currentSettings,
enableSaveButton: false,
enableSaveConfirmation: false,
enableSaveButton: true,
enableSaveConfirmation: true,
autoFocus: autoFocuser.isEnabled()
});
}
@ -48,5 +51,6 @@ define(['subtitleSettings', 'userSettings', 'autoFocuser'], function (SubtitleSe
subtitleSettingsInstance = null;
}
});
};
});
}
/* eslint-enable indent */