1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

update sync menus

This commit is contained in:
Luke Pulverenti 2017-07-15 16:19:58 -04:00
parent 69d25c9816
commit a9f9347768
56 changed files with 56 additions and 103 deletions

View file

@ -1 +1 @@
define(["apphost","globalize","syncJobList","events","localsync","emby-button","paper-icon-button-light"],function(appHost,globalize,syncJobList,events,localSync){"use strict";return function(view,params){function isLocalSyncManagement(){return appHost.supports("sync")&&"offline"==params.mode}function refreshSyncStatus(page){if(isLocalSyncManagement()){var status=localSync.getSyncStatus();"Active"==status?page.querySelector(".btnSyncNow").classList.add("hide"):page.querySelector(".btnSyncNow").classList.remove("hide")}}function syncNow(page){localSync.sync(),require(["toast"],function(toast){toast(Globalize.translate("MessageSyncStarted"))}),refreshSyncStatus(page)}var interval;view.querySelector(".btnSyncNow").addEventListener("click",function(){syncNow(view)}),isLocalSyncManagement()?view.querySelector(".localSyncStatus").classList.remove("hide"):view.querySelector(".localSyncStatus").classList.add("hide");var mySyncJobList=new syncJobList({isLocalSync:"offline"===params.mode,serverId:ApiClient.serverId(),userId:"offline"===params.mode?null:ApiClient.getCurrentUserId(),element:view.querySelector(".syncActivity"),mode:params.mode});view.addEventListener("viewbeforeshow",function(){refreshSyncStatus(view),appHost.supports("sync")&&(interval=setInterval(function(){refreshSyncStatus(view)},5e3))}),view.addEventListener("viewbeforehide",function(){interval&&(clearInterval(interval),interval=null)}),view.addEventListener("viewdestroy",function(){mySyncJobList.destroy()})}});
define(["apphost","globalize","syncJobList","events","localsync","emby-button","paper-icon-button-light"],function(appHost,globalize,syncJobList,events,localSync){"use strict";return function(view,params){var interval,mySyncJobList=new syncJobList({isLocalSync:"offline"===params.mode,serverId:ApiClient.serverId(),userId:"offline"===params.mode?null:ApiClient.getCurrentUserId(),element:view.querySelector(".syncActivity"),mode:params.mode});view.addEventListener("viewbeforehide",function(){interval&&(clearInterval(interval),interval=null)}),view.addEventListener("viewdestroy",function(){mySyncJobList.destroy()})}});