Skip to content

Commit

Permalink
removed magic number 15...
Browse files Browse the repository at this point in the history
Cant check on size < window edge -15 because table might go right up to window edge. Need a different way of checking if table is oversized (like if it is bigger than parent container.
  • Loading branch information
Jon Apgar committed Jul 6, 2014
1 parent 3c8e7c3 commit e2e5207
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions jquery.magiccolumns.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@

var update = function(table) {
// Is the table too big? either left edge or right edge needs to be off-screen
var maxRight = $(window).width()-15;
var maxRight = $(window).width();

// Let's try this... show everything, and then hide stuff until it fits.
$(table).find('th').css({display: 'table-cell'});
Expand All @@ -89,8 +89,7 @@
if (!lastpriority)
return;

while (lastpriority > 0 && ($(table).offset().left < 15 ||
$(table).offset().left + $(table).outerWidth() > maxRight)) {
while (lastpriority > 0 && ($(table).outerWidth() > $(table).parent().width())) {


var numHidden = 0;
Expand Down

0 comments on commit e2e5207

Please sign in to comment.