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

1 line
873 B
JavaScript
Raw Normal View History

2017-09-23 18:05:13 -07:00
define(["subtitleSettings","userSettingsBuilder"],function(SubtitleSettings,userSettingsBuilder){"use strict";return function(view,params){var subtitleSettingsInstance,userId=params.userId||ApiClient.getCurrentUserId(),userSettings=new userSettingsBuilder,autoSave=!0;view.addEventListener("viewshow",function(){subtitleSettingsInstance||(subtitleSettingsInstance=new SubtitleSettings({serverId:ApiClient.serverId(),userId:userId,element:view.querySelector(".settingsContainer"),userSettings:userSettings,enableSaveButton:!autoSave,enableSaveConfirmation:!autoSave})),subtitleSettingsInstance.loadData()}),view.addEventListener("viewbeforehide",function(){autoSave&&subtitleSettingsInstance&&subtitleSettingsInstance.submit()}),view.addEventListener("viewdestroy",function(){subtitleSettingsInstance&&(subtitleSettingsInstance.destroy(),subtitleSettingsInstance=null)})}});