mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-12-05 05:04:20 +00:00
Height Issues For Certain Browsers
I added this in my own personal implementation to fix an issue where the pagerSavedHeightSpacer's height was being calculated incorrectly due to it only taking into account the height of tbody and the height of the trs. Another thing in a table that can add height is the User Agent Style Sheet of the browser adding a border-spacing property (which is usually 2px). This property has been accounted for in the following code. If that property does not exist, it will simply do the same calculation it always has.
This commit is contained in:
parent
31e2376eb6
commit
90b3a9788d
@ -328,7 +328,11 @@
|
|||||||
if (p.fixedHeight && !p.isDisabled) {
|
if (p.fixedHeight && !p.isDisabled) {
|
||||||
h = $.data(table, 'pagerSavedHeight');
|
h = $.data(table, 'pagerSavedHeight');
|
||||||
if (h) {
|
if (h) {
|
||||||
d = h - $b.height();
|
var bs = 0;
|
||||||
|
if($(table).css('border-spacing').split(" ").length>0){
|
||||||
|
bs = $(table).css('border-spacing').split(" ")[0].replace(/[^-\d\.]/g, '');
|
||||||
|
}
|
||||||
|
d = h - $b.height()+(bs*p.size)-bs;
|
||||||
if ( d > 5 && $.data(table, 'pagerLastSize') === p.size &&
|
if ( d > 5 && $.data(table, 'pagerLastSize') === p.size &&
|
||||||
$b.children('tr:visible').length < (p.size === 'all' ? p.totalRows : p.size) ) {
|
$b.children('tr:visible').length < (p.size === 'all' ? p.totalRows : p.size) ) {
|
||||||
$b.append('<tr class="pagerSavedHeightSpacer ' + c.selectorRemove.slice(1) + '" style="height:' + d + 'px;"></tr>');
|
$b.append('<tr class="pagerSavedHeightSpacer ' + c.selectorRemove.slice(1) + '" style="height:' + d + 'px;"></tr>');
|
||||||
|
Loading…
Reference in New Issue
Block a user