Closed townxelliot closed 11 years ago
Hey, thanks for this. After taking a closer look I realized there was more broken about this than just what you had fixed here.
I had to update _bind
as well cause otherwise calling off
before events were bound was causing the events to get bound twice when on
was called.
https://github.com/ccampbell/gator/compare/7ab1b4dc83...c942d0ce68
Also curiously enough keeping the longer variables _handlers[gator.id][event][selector]
instead of setting to a handlers
variable actually is smaller after gzip.
Nice, thanks for incorporating. Interesting about the gzip. I use this in a context where we can't gzip (resources are on the client already), but I didn't check the effect on minification (I just assumed less js and fewer property lookups are "better" in a vague way).
Allow off('event', 'selector') or off('event') to be called before any handlers have been added for a particular event or event/selector combination.
NB I haven't added a minifed version of the library as I'm not sure what your preferred minifier is.