Bug Tracker

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#14704 closed feature (wontfix)

Make .trigger() accept varargs to event data

Reported by: [email protected] Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.10.2
Keywords: Cc:
Blocked by: Blocking:


Whenever I need to pass aditional parameters to .trigger(), I always feel that I could pass those as separate arguments after the event name, and not always as an array.

I'm not sure about backwards-compatibility issues though.

Change History (2)

comment:1 Changed 9 years ago by timmywil

Resolution: wontfix
Status: newclosed

You're right. It is a back-compat issue.

Consider this case...

$elem.trigger('click', [ {}, {} ], [ {}, {} ]);

or worse...

function awesome() {
  $elem.trigger('click', arguments, [ {}, {} ]);

To keep it simple, we've come to recommend that extra arguments always be passed in an array.

comment:2 Changed 9 years ago by [email protected]

I agree, haven't thought about that.

It's not really a big issue actually, just 2 extra chars.

But thanks for the attention!

Note: See TracTickets for help on using tickets.