mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
Pager: maintain pageDisplay ID if one exists. Fixes #1288
This commit is contained in:
parent
0161acff0a
commit
7e11139496
@ -871,7 +871,7 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
enablePager = function(table, p, triggered) {
|
enablePager = function(table, p, triggered) {
|
||||||
var info, size,
|
var info, size, $el,
|
||||||
c = table.config;
|
c = table.config;
|
||||||
p.$size.add(p.$goto).add(p.$container.find('.ts-startRow, .ts-page'))
|
p.$size.add(p.$goto).add(p.$container.find('.ts-startRow, .ts-page'))
|
||||||
.removeClass(p.cssDisabled)
|
.removeClass(p.cssDisabled)
|
||||||
@ -884,9 +884,14 @@
|
|||||||
p.$size.val( p.size ); // set page size
|
p.$size.val( p.size ); // set page size
|
||||||
p.totalPages = p.size === 'all' ? 1 : Math.ceil( getTotalPages( table, p ) / p.size );
|
p.totalPages = p.size === 'all' ? 1 : Math.ceil( getTotalPages( table, p ) / p.size );
|
||||||
// if table id exists, include page display with aria info
|
// if table id exists, include page display with aria info
|
||||||
if ( table.id ) {
|
if ( table.id && !c.$table.attr( 'aria-describedby' ) ) {
|
||||||
|
$el = p.$container.find( p.cssPageDisplay );
|
||||||
|
info = $el.attr( 'id' );
|
||||||
|
if ( !info ) {
|
||||||
|
// only add pageDisplay id if it doesn't exist - see #1288
|
||||||
info = table.id + '_pager_info';
|
info = table.id + '_pager_info';
|
||||||
p.$container.find(p.cssPageDisplay).attr('id', info);
|
$el.attr( 'id', info );
|
||||||
|
}
|
||||||
c.$table.attr( 'aria-describedby', info );
|
c.$table.attr( 'aria-describedby', info );
|
||||||
}
|
}
|
||||||
changeHeight(table, p);
|
changeHeight(table, p);
|
||||||
|
File diff suppressed because one or more lines are too long
2
dist/js/widgets/widget-pager.min.js
vendored
2
dist/js/widgets/widget-pager.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1205,7 +1205,7 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
enablePager: function( c, triggered ) {
|
enablePager: function( c, triggered ) {
|
||||||
var info, size,
|
var info, size, $el,
|
||||||
table = c.table,
|
table = c.table,
|
||||||
p = c.pager;
|
p = c.pager;
|
||||||
p.isDisabled = false;
|
p.isDisabled = false;
|
||||||
@ -1216,9 +1216,14 @@
|
|||||||
p.totalPages = p.size === 'all' ? 1 : Math.ceil( tsp.getTotalPages( c, p ) / p.size );
|
p.totalPages = p.size === 'all' ? 1 : Math.ceil( tsp.getTotalPages( c, p ) / p.size );
|
||||||
c.$table.removeClass( 'pagerDisabled' );
|
c.$table.removeClass( 'pagerDisabled' );
|
||||||
// if table id exists, include page display with aria info
|
// if table id exists, include page display with aria info
|
||||||
if ( table.id ) {
|
if ( table.id && !c.$table.attr( 'aria-describedby' ) ) {
|
||||||
|
$el = p.$container.find( c.widgetOptions.pager_selectors.pageDisplay );
|
||||||
|
info = $el.attr( 'id' );
|
||||||
|
if ( !info ) {
|
||||||
|
// only add pageDisplay id if it doesn't exist - see #1288
|
||||||
info = table.id + '_pager_info';
|
info = table.id + '_pager_info';
|
||||||
p.$container.find( c.widgetOptions.pager_selectors.pageDisplay ).attr( 'id', info );
|
$el.attr( 'id', info );
|
||||||
|
}
|
||||||
c.$table.attr( 'aria-describedby', info );
|
c.$table.attr( 'aria-describedby', info );
|
||||||
}
|
}
|
||||||
tsp.changeHeight( c );
|
tsp.changeHeight( c );
|
||||||
|
Loading…
Reference in New Issue
Block a user