Bug Tracker

Modify

Ticket #1304 (closed bug: duplicate)

Opened 6 years ago

Last modified 6 years ago

Confusing unbind() with "hover"

Reported by: olau Owned by:
Priority: major Milestone: 1.1.3
Component: event Version: 1.1.2
Keywords: Cc:
Blocking: Blocked by:

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

Change History

comment:2 Changed 6 years ago by brandon

  • Status changed from new to closed
  • Resolution set to duplicate

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.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.