Bug Tracker

Ticket #1253 (closed enhancement: fixed)

Opened 2 years ago

Last modified 3 months ago

Allow binding to multiple events simultaneously with .bind()

Reported by: daemach Assigned to: anonymous
Type: enhancement Priority: major
Milestone: 1.2.2 Component: event
Version: 1.1.2 Keywords:
Cc: Needs: Test Case

Description

I was just reading in this cool book "Pro Javascript Techniques" about how it's a good idea to bind events to both keypress and mouse events for accessibility. On that note, I'd like to ask again if you can implement binding to multiple events with bind.

$('#myinput').bind("focus mouseover",function(){doit();})

Attachments

event.js.diff (1.1 kB) - added by brandon 2 years ago.
Patch
event.js.diff2 (0.9 kB) - added by john 2 years ago.
Here's my stab at it - reduce the number of calls to jQuery.event.
event.js2.diff (0.9 kB) - added by john 2 years ago.
It didn't recognize it as a patch, trying again.

Change History

Changed 2 years ago by brandon

Patch

  Changed 2 years ago by brandon

  • need changed from Review to Test Case

Changed 2 years ago by john

Here's my stab at it - reduce the number of calls to jQuery.event.

Changed 2 years ago by john

It didn't recognize it as a patch, trying again.

  Changed 2 years ago by john

  • milestone changed from 1.1.3 to 1.2

Ok, we actually landed this similar functionality for classes in 1.1 (#172), so we should hold this off until 1.2. I've re-tagged the milestone to reflect that.

  Changed 2 years ago by brandon

This latest patch doesn't work for the one method.

I've created a plugin/extension until we can get this into the core. http://blog.brandonaaron.net/2007/06/05/bind-multiple-events-simultaneously-with-jquery/

follow-up: ↓ 6   Changed 1 year ago by brandon

  • milestone changed from 1.2 to 1.2.2

I've started work on this in the branch. I've moved the logic directly into the add and remove event functions.

in reply to: ↑ 5   Changed 1 year ago by brandon

Replying to brandon:

That link should be: event_enhancements branch.

  Changed 1 year ago by cloudream

fixs in r4162

  Changed 1 year ago by davidserduke

  • status changed from new to closed
  • resolution set to fixed

Fixed as cloudream said again. :)

Note: See TracTickets for help on using tickets.