CreateJS / TweenJS

A simple but powerful tweening / animation library for Javascript. Part of the CreateJS suite of libraries.
http://createjs.com/
MIT License
3.56k stars 967 forks source link

make dispatchEvent has same feathers with the w3c event flow #45

Closed wfpaopao closed 7 years ago

wfpaopao commented 10 years ago

Sorry for my bad english.

In modern browser,when we dispatch a event, when eventPhase is 2,the target capturing listeners and bubbling listeners be triggered both.So I has edited some code to sync createjs's Event dispatcher feathers with DOM Event dispatcher.

You can test the following code in google home page by use browser developTool.

var logo = document.querySelector('#hplogo'); var log = function(e){console.log(e.eventPhase, 'clicked')}; logo.addEventListener('click', log, false); logo.addEventListener('click', log, true);

logo.dispatchEvent(new MouseEvent('click', true));

gskinner commented 7 years ago

Thanks for the pull request. I know it's been awhile, but I'm putting this on my list to look at this, likely in the next few days.