I'm pretty sure that is why mootools has the Event object:
el.fireEvent('click',new Event);
On Mon, Aug 30, 2010 at 8:34 AM, Barry van Oudtshoorn <
[email protected]> wrote:
> On 30/08/10 11:42, berlinsurfer wrote:
>
>> How would I possibly do that ? I have seen that a script relies on the
>> event being passed and it's definately easier to generate an event
>> than to refactor the class...
>> I have found http://mootools.net/docs/core/Native/Event but which
>> parameters do I have to use for a simple click event ?
>> Cheers,
>> Jan
>>
>
> 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.
>
>
--
Arieh Glazer
אריה גלזר
052-5348-561
5561