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

update multi-select

This commit is contained in:
Luke Pulverenti 2016-08-16 16:54:13 -04:00
parent cc29283762
commit 89dfdfb110
7 changed files with 160 additions and 104 deletions

View file

@ -0,0 +1,53 @@
define(['serverNotifications', 'events', 'loading', 'connectionManager'], function (serverNotifications, events, loading, connectionManager) {
function onSyncJobsUpdated(e, apiClient, data) {
}
function renderList(listInstance, items) {
}
function fetchData(listInstance) {
listInstance.lastDataLoad = 0;
loading.show();
var options = {};
var apiClient = connectionManager.getApiClient(listInstance.options.serverId);
if (listInstance.options.userId) {
options.UserId = listInstance.options.userId;
}
if (listInstance.options.isLocalSync) {
options.TargetId = apiClient.deviceId();
}
return apiClient.getJSON(ApiClient.getUrl('Sync/Jobs', options)).then(function (response) {
renderList(listInstance, response.Items);
loading.hide();
});
}
function syncJobList(options) {
this.options = options;
var onSyncJobsUpdatedHandler = onSyncJobsUpdated.bind(this);
this.onSyncJobsUpdatedHandler = null;
events.on(serverNotifications, 'SyncJobs', onSyncJobsUpdatedHandler);
fetchData(this);
}
syncJobList.prototype.destroy = function () {
this.options = null;
var onSyncJobsUpdatedHandler = this.onSyncJobsUpdatedHandler;
this.onSyncJobsUpdatedHandler = null;
events.off(serverNotifications, 'SyncJobs', onSyncJobsUpdatedHandler);
};
return syncJobList;
});