Opened 16 years ago
Closed 16 years ago
#1304 closed bug (duplicate)
Confusing unbind() with "hover"
Reported by: | olau | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.1.3 |
Component: | event | Version: | 1.1.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
I have a div element that I bind to with div.hover(...) and with a custom event with div.bind("groupschanged", ...). Now, when I dynamically need to disable the hover, I would have thought I could simply call unbind("hover") on the div. But this removes the binding to the "groupschanged" event too.
Maybe it's just the documentation that's not terribly clear, but I think there's two bugs in this. First that I can't remove the hover event with unbind("hover") (what string do I need to pass?).
Second that unbind("sometype") removes all callbacks if it doesn't find one of the right type. It should only try to remove those of the type "sometype". The latter simply appears to be a question of changing "if (type && element.$events[type])" on line 1224 into a nested if
hover is not actually an event, just a helper. If you need to undo the hover then you can unbind('mouseover').unbind('mouseout'). The other part is fixed and logged at #1047.