Skip to content

Commit

Permalink
Merge modified pull request: zurb#13.
Browse files Browse the repository at this point in the history
  • Loading branch information
NicholasRBowers committed Apr 15, 2015
1 parent 2d5a09d commit 6530609
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions responsive-tables.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,24 @@

$(document).ready(function() {
var responsiveBoundary = 767;

var switched = false;

var updateTables = function() {
if (($(window).width() < responsiveBoundary) && !switched ){

var scrollBarWidth = 0;

if ( !(window.mozInnerScreenX == null) ) {
scrollBarWidth = window.innerWidth - $("body").width();
}

if ( ($(window).width() < responsiveBoundary - scrollBarWidth && !switched )
switched = true;
$("table.responsive").each(function(i, element) {
splitTable($(element));
});
return true;
}
else if (switched && ($(window).width() > responsiveBoundary)) {
else if ( switched && ($(window).width() > responsiveBoundary - scrollBarWidth) ) {
switched = false;
$("table.responsive").each(function(i, element) {
unsplitTable($(element));
Expand Down

0 comments on commit 6530609

Please sign in to comment.