Skip to main content

Bug Tracker

Side navigation

#14704 closed feature (wontfix)

Opened January 17, 2014 12:40PM UTC

Closed January 23, 2014 04:47PM UTC

Last modified January 23, 2014 05:04PM UTC

Make .trigger() accept varargs to event data

Reported by: rodolfo@rodolfoferreira.com.br Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.10.2
Keywords: Cc:
Blocked by: Blocking:
Description

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.

Attachments (0)
Change History (2)

Changed January 23, 2014 04:47PM UTC by timmywil comment:1

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.

Changed January 23, 2014 05:04PM UTC by rodolfo@rodolfoferreira.com.br comment:2

I agree, haven't thought about that.

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

But thanks for the attention!