mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-21 22:04:31 -04:00
Added pagination to Missing
This commit is contained in:
@@ -7,7 +7,8 @@ define(['app', 'Missing/MissingItemView'], function (app) {
|
||||
template: 'Missing/MissingCollectionTemplate',
|
||||
|
||||
ui:{
|
||||
table : '.x-missing-table'
|
||||
table : '.x-missing-table',
|
||||
pager : '.x-missing-table-pager'
|
||||
},
|
||||
|
||||
initialize: function (context, action, query, collection) {
|
||||
@@ -42,34 +43,46 @@ define(['app', 'Missing/MissingItemView'], function (app) {
|
||||
}
|
||||
});
|
||||
|
||||
//Todo: We should extract these common settings out
|
||||
this.ui.table.find('th.header').each(function(){
|
||||
$(this).append('<i class="icon-sort pull-right">');
|
||||
this.ui.table.bind('pagerComplete pagerInitialized', function(event, c){
|
||||
c.container.find('.page-number').text(c.page + 1);
|
||||
});
|
||||
|
||||
this.ui.table.tablesorterPager({
|
||||
container: this.ui.pager,
|
||||
output: 'Displaying {startRow} to {endRow} of {totalRows} episodes'
|
||||
});
|
||||
|
||||
this.applySortIcons();
|
||||
|
||||
this.ui.table.bind("sortEnd", function() {
|
||||
$(this).find('th.header i').each(function(){
|
||||
$(this).remove();
|
||||
});
|
||||
|
||||
$(this).find('th.header').each(function () {
|
||||
if (!$(this).hasClass('headerSortDown') && !$(this).hasClass('headerSortUp'))
|
||||
$(this).append('<i class="icon-sort pull-right">');
|
||||
});
|
||||
|
||||
$(this).find('th.headerSortDown').each(function(){
|
||||
$(this).append('<i class="icon-sort-up pull-right">');
|
||||
});
|
||||
|
||||
$(this).find('th.headerSortUp').each(function(){
|
||||
$(this).append('<i class="icon-sort-down pull-right">');
|
||||
});
|
||||
this.applySortIcons();
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ui.table.trigger('update');
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
//Todo: Remove this from each view that requires it
|
||||
applySortIcons: function() {
|
||||
$(this.ui.table).find('th.tablesorter-header .tablesorter-header-inner i').each(function(){
|
||||
$(this).remove();
|
||||
});
|
||||
|
||||
$(this.ui.table).find('th.tablesorter-header').each(function () {
|
||||
if ($(this).hasClass('tablesorter-headerDesc'))
|
||||
$(this).children('.tablesorter-header-inner').append('<i class="icon-sort-up pull-right">');
|
||||
|
||||
else if ($(this).hasClass('tablesorter-headerAsc'))
|
||||
$(this).children('.tablesorter-header-inner').append('<i class="icon-sort-down pull-right">');
|
||||
|
||||
else if (!$(this).hasClass('sorter-false'))
|
||||
$(this).children('.tablesorter-header-inner').append('<i class="icon-sort pull-right">');
|
||||
});
|
||||
},
|
||||
updatePageNumber: function(event, stuff) {
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user