ericjgagnon / wickedpicker

A simple jQuery timepicker
http://ericjgagnon.github.io/wickedpicker/
MIT License
93 stars 78 forks source link

Feature request: support 'hide' and 'show' methods #31

Open tylerwilson opened 8 years ago

tylerwilson commented 8 years ago

I currently use both datepicker and wickedpicker. I need to hide the picker when a user scrolls or resizes the window. The datepicker supports $(element).datapicker('hide') for this purpose, but I cannot find a similar $(element).wickedpicker('hide') method, and cannot get a handle to the wickedpicker to hide it either. It seems like this is a pretty standard API - hide and show. Would love to have it here too.

paulosalvatore commented 7 years ago

Replace https://github.com/ericjgagnon/wickedpicker/blob/master/src/wickedpicker.js#L208-L214 with this:

$(element).on('click focus', function (event) {
    self.hideTimepicker(element);
    self.showPicker($(this));
    $(self.hoursElem).focus();
});