quicksketch / timezonepicker

A jQuery and ImageMap based timezone picker.
52 stars 24 forks source link

Add changeHandler opt #10

Closed fardjad closed 10 years ago

fardjad commented 10 years ago

I just added the changeHandler option.

It should be a function with the following signature:

changeHandler (timezoneName, countryName, offset)

which gets called upon timezone change.

That makes timezonepicker much easier to use on Android/JavaFX WebView or similar environments via a bridge.

Also I used uglifyjs with default options for minification. Let me know if there's a better minifier/configuration that I should use.

quicksketch commented 10 years ago

Thanks! Could this problem also be solved by https://github.com/quicksketch/timezonepicker/pull/5? That would allow you to bind directly to the browser-level change events.

Otherwise, this looks like a good option to have, but it should also be documented.

fardjad commented 10 years ago

Yes, but I think this one is more flexible than #5.

I already added the following lines to README.md

// A function to be called upon timezone change
// timezoneName, countryName, and offset will be passed as arguments
changeHandler: null

should I document it anywhere else?

quicksketch commented 10 years ago

Sure, I think that would be adequate. I've got a few other minor nitpicks that I'll add to the diff.

fardjad commented 10 years ago

Done.

quicksketch commented 10 years ago

Super. Thanks!