From e2e5207607325c7294112a91a5cf2d23eeda58fd Mon Sep 17 00:00:00 2001 From: Jon Apgar Date: Sat, 5 Jul 2014 21:31:12 -0400 Subject: [PATCH] removed magic number 15... 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. --- jquery.magiccolumns.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/jquery.magiccolumns.js b/jquery.magiccolumns.js index 5e0396a..835d8d3 100644 --- a/jquery.magiccolumns.js +++ b/jquery.magiccolumns.js @@ -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'}); @@ -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;