Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Height Issues For Certain Browsers #1418

Merged
merged 2 commits into from
Jun 8, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion addons/pager/jquery.tablesorter.pager.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,11 @@
if (p.fixedHeight && !p.isDisabled) {
h = $.data(table, 'pagerSavedHeight');
if (h) {
d = h - $b.height();
var bs = 0;
if($(table).css('border-spacing').split(" ").length>0){
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This if statement should always be true.... is there a particular browser where it isn't? When I use $('table').css('border-spacing') on a table without any css changes, I will see 2px 2px.

bs = $(table).css('border-spacing').split(" ")[0].replace(/[^-\d\.]/g, '');
Copy link
Owner

@Mottie Mottie Jun 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The second border-spacing value should be used here because it contains the vertical size (ref)

/* border-spacing: horizontal vertical */
border-spacing: 1cm 2em;

}
d = h - $b.height()+(bs*p.size)-bs;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The demo doesn't appear to work for me... it is because of the -bs on the end?

if ( d > 5 && $.data(table, 'pagerLastSize') === 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>');
Expand Down