icecats11 / js-hotkeys

Automatically exported from code.google.com/p/js-hotkeys
0 stars 0 forks source link

API Change Question #28

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Sorry, not sure where else to put this.  According to the new API:
"The plugin extends the following jQuery methods and functions:

    * $.fn.bind
    * $.fn.unbind
    * $.find 

The plugin takes over the control for bind() and unbind() methods. "

So...my question is:  What does this do to people that are currently using
jQuery and the bind, unbind and find methods?  Does it make those methods
unusable for them in their intended jQuery context?

Not a problem for me, our project is using Prototype.  More of a general
question.

Original issue reported on code.google.com by thadw...@gmail.com on 8 Sep 2008 at 5:05

GoogleCodeExporter commented 8 years ago
Might be a good topic for a wiki page...like a FAQ.  Of course, maybe the 
question
has only been asked once!

Original comment by thadw...@gmail.com on 8 Sep 2008 at 5:10

GoogleCodeExporter commented 8 years ago
You can safely use bind unbind and find.
The plugin takeover only in the relevant cases when you call it for
keyup/keydown/keypress events and you supllied the data such as 'ctrl+x' or the
object {combi: ctrl+x, propagate: false} etc.
quoting from: http://code.google.com/p/js-hotkeys/wiki/about
The plugin takes over the control for bind() and unbind() methods.

*However, it only handle the keydown, keyup and keypress event types. Any other 
types
are passed to the original bind() and unbind() methods.

Moreover, if you call bind() without passing the shortcut key combination e.g.
$(document).bind('keydown', fn) it will pass it as well to jQuery 'bind()' 
method. *

Original comment by Afro.Sys...@gmail.com on 8 Sep 2008 at 5:20

GoogleCodeExporter commented 8 years ago
Moreover, I am kinda checking a new approach which was recommended to me by John
Resig which will prevent the overriding and will keep the unified event binding
interface. But again, the original methods are still doing their job.

Original comment by Afro.Sys...@gmail.com on 8 Sep 2008 at 5:22

GoogleCodeExporter commented 8 years ago
Well duhhh...I should have read a little further!

Original comment by thadw...@gmail.com on 8 Sep 2008 at 5:23

GoogleCodeExporter commented 8 years ago

Original comment by Afro.Sys...@gmail.com on 10 Sep 2008 at 3:12