sliderAccess tweak
This commit is contained in:
parent
cc45f6a6d8
commit
ac38588138
1 changed files with 14 additions and 12 deletions
26
jquery-ui-timepicker-addon.js
vendored
26
jquery-ui-timepicker-addon.js
vendored
|
@ -639,20 +639,22 @@ $.extend(Timepicker.prototype, {
|
||||||
if (this._defaults.addSliderAccess){
|
if (this._defaults.addSliderAccess){
|
||||||
var sliderAccessArgs = this._defaults.sliderAccessArgs;
|
var sliderAccessArgs = this._defaults.sliderAccessArgs;
|
||||||
setTimeout(function(){ // fix for inline mode
|
setTimeout(function(){ // fix for inline mode
|
||||||
$tp.find('.ui-slider:visible').sliderAccess(sliderAccessArgs);
|
if($tp.find('.ui-slider-access').length == 0){
|
||||||
|
$tp.find('.ui-slider:visible').sliderAccess(sliderAccessArgs);
|
||||||
|
|
||||||
// fix any grids since sliders are shorter
|
// fix any grids since sliders are shorter
|
||||||
var sliderAccessWidth = $tp.find('.ui-slider-access:eq(0)').outerWidth(true);
|
var sliderAccessWidth = $tp.find('.ui-slider-access:eq(0)').outerWidth(true);
|
||||||
if(sliderAccessWidth){
|
if(sliderAccessWidth){
|
||||||
$tp.find('table:visible').each(function(){
|
$tp.find('table:visible').each(function(){
|
||||||
var $g = $(this),
|
var $g = $(this),
|
||||||
oldWidth = $g.outerWidth(),
|
oldWidth = $g.outerWidth(),
|
||||||
oldMarginLeft = $g.css('marginLeft').toString().replace('%',''),
|
oldMarginLeft = $g.css('marginLeft').toString().replace('%',''),
|
||||||
newWidth = oldWidth - sliderAccessWidth,
|
newWidth = oldWidth - sliderAccessWidth,
|
||||||
newMarginLeft = ((oldMarginLeft * newWidth)/oldWidth) + '%';
|
newMarginLeft = ((oldMarginLeft * newWidth)/oldWidth) + '%';
|
||||||
|
|
||||||
$g.css({ width: newWidth, marginLeft: newMarginLeft });
|
$g.css({ width: newWidth, marginLeft: newMarginLeft });
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},0);
|
},0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue