Skip to content

Commit f7eafa9

Browse files
Adj grids only when slideAccess visible
1 parent fab4a44 commit f7eafa9

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

jquery-ui-timepicker-addon.js

+11-8
Original file line numberDiff line numberDiff line change
@@ -643,18 +643,21 @@ $.extend(Timepicker.prototype, {
643643

644644
// fix any grids since sliders are shorter
645645
var sliderAccessWidth = $tp.find('.ui-slider-access:eq(0)').outerWidth(true);
646-
$tp.find('table:visible').each(function(){
647-
var $g = $(this),
648-
oldWidth = $g.outerWidth(),
649-
oldMarginLeft = $g.css('marginLeft').toString().replace('%',''),
650-
newWidth = oldWidth - sliderAccessWidth,
651-
newMarginLeft = ((oldMarginLeft * newWidth)/oldWidth) + '%';
646+
if(sliderAccessWidth){
647+
$tp.find('table:visible').each(function(){
648+
var $g = $(this),
649+
oldWidth = $g.outerWidth(),
650+
oldMarginLeft = $g.css('marginLeft').toString().replace('%',''),
651+
newWidth = oldWidth - sliderAccessWidth,
652+
newMarginLeft = ((oldMarginLeft * newWidth)/oldWidth) + '%';
652653

653-
$g.css({ width: newWidth, marginLeft: newMarginLeft });
654-
});
654+
$g.css({ width: newWidth, marginLeft: newMarginLeft });
655+
});
656+
}
655657
},0);
656658
}
657659
// end slideAccess integration
660+
658661
}
659662
},
660663

0 commit comments

Comments
 (0)