jellyfin-web/dashboard-ui/scripts/mypreferenceshome.js

1 line
1001 B
JavaScript
Raw Normal View History

2017-09-23 18:05:13 -07:00
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,autoSave=!0;view.addEventListener("viewshow",function(){homescreenSettingsInstance||(homescreenSettingsInstance=new HomescreenSettings({serverId:ApiClient.serverId(),userId:userId,element:view.querySelector(".homeScreenSettingsContainer"),userSettings:userSettings,enableSaveButton:!autoSave,enableSaveConfirmation:!autoSave})),homescreenSettingsInstance.loadData()}),view.addEventListener("viewbeforehide",function(){autoSave&&homescreenSettingsInstance&&homescreenSettingsInstance.submit()}),view.addEventListener("viewdestroy",function(){homescreenSettingsInstance&&(homescreenSettingsInstance.destroy(),homescreenSettingsInstance=null)})}});