jquery-timepicker icon indicating copy to clipboard operation
jquery-timepicker copied to clipboard

Close on Window Scroll Issue

Open joshua5822 opened this issue 11 years ago • 2 comments
trafficstars

closeOnWindowScroll did not work for me when the element that scrolls is not the body. It was an easy fix for me, since I have jQuery UI and can use scollParent on self.

$(document).on('scroll.ui-timepicker', _closeHandler); I changed it to this: self.scrollParent().on('scroll.ui-timepicker', _closeHandler);

I know it is not a valid solution though to include jQuery UI as a requirement simply to fix a small issue. I don't have any other solutions right now, but I thought it would be best to at least inform you.

joshua5822 avatar Feb 06 '14 21:02 joshua5822

Thanks! I agree it doesn't make sense to include such a large library to fix a small problem. This will be handy to others who need a workaround.

jonthornton avatar Feb 07 '14 05:02 jonthornton

Suggestion: Rename closeOnWindowScroll into closeOnScroll Value: boolean | css selector | HTMLelement If the value is a boolean and is equal to true set the selector to document

// handle boolean case in _parseSettings()
if (settings.closeOnScroll) {
    $(settings.closeOnScroll).on('scroll.ui-timepicker', _closeHandler);
}

QuentinFchx avatar Oct 14 '15 21:10 QuentinFchx