I didn't peek at the code (much), but the demo was very nice. I preferred it to a handful of others that I've tried. I can think of a couple of situations where it might come in handy.
I can think of only a few things I would change: - Allow interval to be a function (accepts attributes currentValue and op =up|down|reset) to allow for odd patterns (powers of two, Fibonacci, exponential growth, whatever). - Does it fire onChange observers? - (Personal preference), move the up/down ids into the options rather than be their own parameters. Create them if not specified. - Allow "power" intervals (maybe this goes along with the function idea), where the interval is different if the shift or meta key is held down. TAG On Jul 15, 2007, at 9:27 PM, Ken Snyder wrote: > > I really liked the functionality of the dojo spinner control > example, so > I went ahead and did my own. Demo and source here: > > http://kendsnyder.com/sandbox/Spinner/demo.1.0.html > > It uses mousedown to allow continuous incrementing which speeds up > over > time. It also implements keydown to allow up and down arrow control > while focused on the input. > > The trickiest part was accounting for a case that even the dojo > example > didn't address: keyup doesn't get fired on the up or down element > if you > make a drag action outside of the element. This is solved by > attaching > an additional mouseout event that also stops the incrementing. > > -- Ken Snyder > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
