summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrent <trentdrichardson@gmail.com>2011-12-02 13:44:58 -0500
committerTrent <trentdrichardson@gmail.com>2011-12-02 13:44:58 -0500
commitf7eafa98494a0c2642b6a44313f4975ce0407021 (patch)
treeee6bb8dde2e3356c1299c0eed850697dba10e259
parentfab4a4428a3f31e710bafc05acb217ca5f6008fb (diff)
downloadjQuery-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.js19
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
+
}
},