Closed lexey111 closed 10 years ago
Thanks for catching that. Sorry for wasting your time!
@dmauro
Consider using John Resig's self-calling constructor pattern, e.g. adding the following to the beginning of your constructor:
if (!(this instanceof Listener)) return new Listener(element, defaults);
This will allow omitting new
, like no one writes new $
for John Resig's jQuery.
Please, replace "var listener = window.keypress.Listener();" to "var listener = new window.keypress.Listener();" on your site.
I had an interesting five minutes to understand why it does not work when I copied it from your example :)