diff options
author | Trent Richardson <trentdrichardson@gmail.com> | 2011-12-04 09:48:06 -0500 |
---|---|---|
committer | Trent Richardson <trentdrichardson@gmail.com> | 2011-12-04 09:48:06 -0500 |
commit | dc15bf6bc5e0ae0ae37e45831cb3369b1e718d55 (patch) | |
tree | 32d7fd18149079c86ae24304e47c96bc6b0ca73d /jquery-ui-timepicker-addon.js | |
parent | 9963f68ad5a9e0f1193e4c8f92e99a11ccaea1e9 (diff) | |
download | jQuery-Timepicker-Addon-dc15bf6bc5e0ae0ae37e45831cb3369b1e718d55.zip jQuery-Timepicker-Addon-dc15bf6bc5e0ae0ae37e45831cb3369b1e718d55.tar.gz jQuery-Timepicker-Addon-dc15bf6bc5e0ae0ae37e45831cb3369b1e718d55.tar.bz2 |
sliderAccess tweak
Diffstat (limited to 'jquery-ui-timepicker-addon.js')
-rw-r--r-- | jquery-ui-timepicker-addon.js | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/jquery-ui-timepicker-addon.js b/jquery-ui-timepicker-addon.js index 88284d4..f111244 100644 --- a/jquery-ui-timepicker-addon.js +++ b/jquery-ui-timepicker-addon.js @@ -639,20 +639,22 @@ $.extend(Timepicker.prototype, { if (this._defaults.addSliderAccess){ var sliderAccessArgs = this._defaults.sliderAccessArgs; setTimeout(function(){ // fix for inline mode - $tp.find('.ui-slider:visible').sliderAccess(sliderAccessArgs); - - // fix any grids since sliders are shorter - var sliderAccessWidth = $tp.find('.ui-slider-access:eq(0)').outerWidth(true); - 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) + '%'; + if($tp.find('.ui-slider-access').length == 0){ + $tp.find('.ui-slider:visible').sliderAccess(sliderAccessArgs); + + // fix any grids since sliders are shorter + var sliderAccessWidth = $tp.find('.ui-slider-access:eq(0)').outerWidth(true); + 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); } |