The simplest way to do it is to look at the functions that are handling
the click, and create an anonymous object with stubs. That is to say,
blah.fireEvent('click', {
stop: $empty,
preventDefault: $empty,
// etc.
});
--
Barry van Oudtshoorn
www.barryvan.com.au
Not sent from my Apple πPhone.
I'm pretty sure that is why mootools has the Event object:
el.fireEvent('click',new Event);
Note Event ctor doesn't need a real event in IE.
-- S.
When you are using a third-party (or inalterable for some other
reason) event handler that expects an Event to be passed and doesn't
create its own mock `e` internally when it's been fake-fired. IOW,
when you want to fire an event handler that depends on an event (even
though the two could/should be separate).
You can fake a duck-typed Event, as Barry suggested, by adding the
minimal props to a simple Object, but this requires inspecting the
handler code in depth and could be really annoying to maintain. Pass
it a real Event and you shouldn't need to worry about faking anything.
-- S.