(function () { function reload(page) { Dashboard.showLoadingMsg(); ApiClient.getJSON(ApiClient.getUrl("Notifications/Types")).then(function (list) { var html = ''; var lastCategory = ""; html += list.map(function (i) { var itemHtml = ''; if (i.Category != lastCategory) { lastCategory = i.Category; if (lastCategory) { itemHtml += ''; } itemHtml += '

'; itemHtml += i.Category; itemHtml += '

'; itemHtml += '
'; } itemHtml += ''; itemHtml += ''; if (i.Enabled) { itemHtml += ''; } else { itemHtml += ''; } itemHtml += ''; itemHtml += '
' + i.Name + '
'; itemHtml += '
'; itemHtml += ''; itemHtml += '
'; itemHtml += '
'; return itemHtml; }).join(''); if (list.length) { html += '
'; } $('.notificationList', page).html(html).trigger('create'); Dashboard.hideLoadingMsg(); }); } $(document).on('pageshow', "#notificationSettingsPage", function () { var page = this; require(['paper-fab', 'paper-item-body', 'paper-icon-item'], function () { reload(page); }); }); })(jQuery, window);