From f7eafa98494a0c2642b6a44313f4975ce0407021 Mon Sep 17 00:00:00 2001 From: Trent Date: Fri, 2 Dec 2011 13:44:58 -0500 Subject: [PATCH] Adj grids only when slideAccess visible --- jquery-ui-timepicker-addon.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/jquery-ui-timepicker-addon.js b/jquery-ui-timepicker-addon.js index ecf9a6b..d14b11b 100644 --- a/jquery-ui-timepicker-addon.js +++ b/jquery-ui-timepicker-addon.js @@ -643,18 +643,21 @@ $.extend(Timepicker.prototype, { // fix any grids since sliders are shorter var sliderAccessWidth = $tp.find('.ui-slider-access:eq(0)').outerWidth(true); - $tp.find('table:visible').each(function(){ - var $g = $(this), - oldWidth = $g.outerWidth(), - oldMarginLeft = $g.css('marginLeft').toString().replace('%',''), - newWidth = oldWidth - sliderAccessWidth, - newMarginLeft = ((oldMarginLeft * newWidth)/oldWidth) + '%'; + if(sliderAccessWidth){ + $tp.find('table:visible').each(function(){ + var $g = $(this), + oldWidth = $g.outerWidth(), + oldMarginLeft = $g.css('marginLeft').toString().replace('%',''), + newWidth = oldWidth - sliderAccessWidth, + newMarginLeft = ((oldMarginLeft * newWidth)/oldWidth) + '%'; - $g.css({ width: newWidth, marginLeft: newMarginLeft }); - }); + $g.css({ width: newWidth, marginLeft: newMarginLeft }); + }); + } },0); } // end slideAccess integration + } },