mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-18 11:28:23 -07:00
1 line
1.0 KiB
JavaScript
1 line
1.0 KiB
JavaScript
define(["homescreenSettings","userSettingsBuilder","dom","globalize","loading","userSettings","listViewStyle"],function(HomescreenSettings,userSettingsBuilder,dom,globalize,loading,currentUserSettings){"use strict";return function(view,params){var homescreenSettingsInstance,userId=params.userId||ApiClient.getCurrentUserId(),userSettings=userId===ApiClient.getCurrentUserId()?currentUserSettings:new userSettingsBuilder,autoSave=!0;view.addEventListener("viewshow",function(){homescreenSettingsInstance?homescreenSettingsInstance.loadData():homescreenSettingsInstance=new HomescreenSettings({serverId:ApiClient.serverId(),userId:userId,element:view.querySelector(".homeScreenSettingsContainer"),userSettings:userSettings,enableSaveButton:!autoSave,enableSaveConfirmation:!autoSave})}),view.addEventListener("viewbeforehide",function(){autoSave&&homescreenSettingsInstance&&homescreenSettingsInstance.submit()}),view.addEventListener("viewdestroy",function(){homescreenSettingsInstance&&(homescreenSettingsInstance.destroy(),homescreenSettingsInstance=null)})}}); |