thooyork / thooClock

jQuery analogue AlarmClock Plugin
MIT License
30 stars 17 forks source link

Removing the alarm hand #3

Closed soif closed 9 years ago

soif commented 9 years ago

Hi Congratulation for your beautifull clock !

I've noticed that the alarm hand doe not disapear when the alarm time is over. I've neither found any method to remove it, once displayed.

Would it be possible to add a (externally callable) method to simply remove the alarm hand , or a method to unset the alarm (when set) that also remove her alarm hand.

As my Javascript drawing understanding is near zero, I may be missed something.

Thanks

soif commented 9 years ago

Following your reply in #4

If you could just tell me what is the "magic code line" that can remove the alarm hand from the canvas, i would be happy, to build the full methods, update the class / test it / implement options for it , and update your documentation for you as another PullRequest. While this feature is not really needed for my own project, it would certainly help others people.

I've just absolutely no idea on how drawing canvas works, and i guess it would be a very long learning curve for me to understand it.

cheers

thooyork commented 9 years ago

Ok, I wrote a function to clear the alarm time and to remove the alarm hand . you can now just call: $.fn.thooClock.clearAlarm(); and alarm time will be set to undefined. "removing" the alarm hand is not that simple, it basically comes to clear the entire canvas and then redraw the dial and the hands (without the alarm hand) cause that is how drawing on canvas works here ... hope this helps..

soif commented 9 years ago

absolutely terrific . Thanks ! going to add some fixes and enhancements !