2014-06-15 16:30:04 -07:00
|
|
|
|
(function ($, document) {
|
|
|
|
|
|
2014-06-17 09:03:14 -07:00
|
|
|
|
function reloadItems(page) {
|
|
|
|
|
|
2015-07-19 20:43:13 -07:00
|
|
|
|
Dashboard.showLoadingMsg();
|
|
|
|
|
|
|
|
|
|
Sections.loadLatestChannelItems(page.querySelector('.latestItems'), Dashboard.getCurrentUserId()).always(function() {
|
|
|
|
|
Dashboard.hideLoadingMsg();
|
|
|
|
|
});
|
2014-06-15 16:30:04 -07:00
|
|
|
|
}
|
|
|
|
|
|
2015-07-18 11:07:03 -07:00
|
|
|
|
function loadTab(page, index) {
|
2014-06-15 16:30:04 -07:00
|
|
|
|
|
2015-07-18 11:07:03 -07:00
|
|
|
|
switch (index) {
|
|
|
|
|
|
|
|
|
|
case 0:
|
|
|
|
|
reloadItems(page);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-09-01 07:01:59 -07:00
|
|
|
|
$(document).on('pageinit', "#channelsPage", function () {
|
2015-07-18 11:07:03 -07:00
|
|
|
|
|
|
|
|
|
var page = this;
|
|
|
|
|
var pages = page.querySelector('neon-animated-pages');
|
|
|
|
|
|
|
|
|
|
$(pages).on('tabchange', function () {
|
|
|
|
|
loadTab(page, parseInt(this.selected));
|
|
|
|
|
});
|
2014-06-15 16:30:04 -07:00
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
})(jQuery, document);
|