fgelinas / timepicker

A jQuery UI Time Picker
http://fgelinas.com/code/timepicker
GNU General Public License v2.0
266 stars 84 forks source link

Timepicker buttons not binding to the correct timepicker on page #55

Open borzale opened 11 years ago

borzale commented 11 years ago

Hey there,

While using this plugin today I found a problem where if I had more than one timepicker on the page which used a button to open, it would not take into account all the timepickers. It would just bind it to the last one.

The problem line seems to be here (#280): $(button).bind("click.timepicker", function () {

I have gone ahead and quickly changed it to suit my application. As in, all my timepickers are contained in their own parent div element. It will use the input variable to bind the event, rather than inserting it straight into a jQuery selector object: input.parent().find(button).bind("click.timepicker", function () {

This is not the best solution and won't work for everyone, but I thought it would be helpful pointing out the issue.

Cheers, thanks for the plugin!