jellyfin-web/dashboard-ui/scripts/mypreferenceshome.js
2017-04-11 12:38:22 -04:00

1 line
1.0 KiB
JavaScript

define(["homescreenSettings","userSettingsBuilder","dom","globalize","loading","homeSections","listViewStyle"],function(HomescreenSettings,userSettingsBuilder,dom,globalize,loading,homeSections){"use strict";return function(view,params){var homescreenSettingsInstance,userId=params.userId||ApiClient.getCurrentUserId(),userSettings=new userSettingsBuilder;view.addEventListener("viewshow",function(){homescreenSettingsInstance||(homescreenSettingsInstance=new HomescreenSettings({serverId:ApiClient.serverId(),userId:userId,element:view.querySelector(".homeScreenSettingsContainer"),userSettings:userSettings,enableSaveButton:!AppInfo.enableAutoSave,enableSaveConfirmation:!AppInfo.enableAutoSave})),homescreenSettingsInstance.loadData()}),view.addEventListener("viewbeforehide",function(){AppInfo.enableAutoSave&&homescreenSettingsInstance&&homescreenSettingsInstance.submit()}),view.addEventListener("viewdestroy",function(){homescreenSettingsInstance&&(homescreenSettingsInstance.destroy(),homescreenSettingsInstance=null)})}});