Alternatively if you wanted to fire to only the leaf nodes in the tree
(those without children), then you could add a filter. This should
all the event to bubble up to any other listeners:
Element e = new Element.tag('div');
document.body.elements.add(e);
e.on.click.add((ev){
print("You clicked me, didn't you?");
});
document.body.queryAll('*')
.filter((element) => element.elements.isEmpty())
.forEach((element){
element.on.click.dispatch(new MouseEvent('click', window, 0,
200, 300, 400, 500, 0));
});
On Apr 23, 10:05 am, Alexander Orlov <
alexander.or...@loxal.net>
wrote:
> On Mon, Apr 23, 2012 at 4:57 PM, John Evans <
pruj...@gmail.com> wrote:
> > If you are trying to fire events manually, this works:
>
> > Element e = new Element.tag('div');
> > e.on.click.add((ev){
> > print("You clicked me, didn't you?");
>
> > });
>
> > e.on.click.dispatch(new Event('click'));
>
> But what if I want just to fire a click *without referencing a particular
> Element*? I want to provide x/y coordinates as properties of the click