(function () { function getSyncTargetName(targets, id) { var target = targets.filter(function (t) { return t.Id == id; })[0]; return target ? target.Name : 'Unknown Device'; } function getSyncJobHtml(job) { var html = ''; html += "
' + targetName + '
'; lastTargetName = targetName; } html += getSyncJobHtml(job); } $('.syncActivity', page).html(html).trigger('create'); } $(document).on('pageshow', "#dashboardSyncPage", function () { Dashboard.showLoadingMsg(); var page = this; var promise1 = ApiClient.getJSON(ApiClient.getUrl('Sync/Jobs')); var promise2 = ApiClient.getJSON(ApiClient.getUrl('Sync/Targets')); $.when(promise1, promise2).done(function (response1, response2) { loadData(page, response1[0].Items, response2[0]); Dashboard.hideLoadingMsg(); }); }).on('pageinit', "#dashboardSyncPage", function () { var page = this; }); })();