summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrent Richardson <trentdrichardson@gmail.com>2011-12-04 09:45:23 -0500
committerTrent Richardson <trentdrichardson@gmail.com>2011-12-04 09:45:23 -0500
commitac38588138c1c91b766a48a9c97f1f8dae0ca450 (patch)
tree86521896067ac4955693df4bca0ba552ddd158d9
parentcc45f6a6d85efdfa0b51e1868425ae0a0d47f0bb (diff)
downloadjQuery-Timepicker-Addon-ac38588138c1c91b766a48a9c97f1f8dae0ca450.zip
jQuery-Timepicker-Addon-ac38588138c1c91b766a48a9c97f1f8dae0ca450.tar.gz
jQuery-Timepicker-Addon-ac38588138c1c91b766a48a9c97f1f8dae0ca450.tar.bz2
sliderAccess tweak
-rw-r--r--jquery-ui-timepicker-addon.js28
1 files changed, 15 insertions, 13 deletions
diff --git a/jquery-ui-timepicker-addon.js b/jquery-ui-timepicker-addon.js
index 1a4877f..752e908 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);
}