diff options
author | Trent <trentdrichardson@gmail.com> | 2011-12-02 13:44:58 -0500 |
---|---|---|
committer | Trent <trentdrichardson@gmail.com> | 2011-12-02 13:44:58 -0500 |
commit | f7eafa98494a0c2642b6a44313f4975ce0407021 (patch) | |
tree | ee6bb8dde2e3356c1299c0eed850697dba10e259 | |
parent | fab4a4428a3f31e710bafc05acb217ca5f6008fb (diff) | |
download | jQuery-Timepicker-Addon-f7eafa98494a0c2642b6a44313f4975ce0407021.zip jQuery-Timepicker-Addon-f7eafa98494a0c2642b6a44313f4975ce0407021.tar.gz jQuery-Timepicker-Addon-f7eafa98494a0c2642b6a44313f4975ce0407021.tar.bz2 |
Adj grids only when slideAccess visible
-rw-r--r-- | jquery-ui-timepicker-addon.js | 19 |
1 files 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 + } }, |