jellyfin-web/dashboard-ui/scripts/mypreferenceslanguages.js
2017-09-23 21:05:13 -04:00

1 line
867 B
JavaScript

define(["playbackSettings","userSettingsBuilder","dom","globalize","loading","listViewStyle"],function(PlaybackSettings,userSettingsBuilder,dom,globalize,loading){"use strict";return function(view,params){var settingsInstance,userId=params.userId||ApiClient.getCurrentUserId(),userSettings=new userSettingsBuilder,autoSave=!0;view.addEventListener("viewshow",function(){settingsInstance||(settingsInstance=new PlaybackSettings({serverId:ApiClient.serverId(),userId:userId,element:view.querySelector(".settingsContainer"),userSettings:userSettings,enableSaveButton:!autoSave,enableSaveConfirmation:!autoSave})),settingsInstance.loadData()}),view.addEventListener("viewbeforehide",function(){autoSave&&settingsInstance&&settingsInstance.submit()}),view.addEventListener("viewdestroy",function(){settingsInstance&&(settingsInstance.destroy(),settingsInstance=null)})}});