mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-18 19:38:20 -07:00
1 line
798 B
JavaScript
1 line
798 B
JavaScript
define(["displaySettings","userSettingsBuilder"],function(DisplaySettings,userSettingsBuilder){"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 DisplaySettings({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)})}}); |