0
Почему мое событие не возбуждено в foo
пузырьков до bar
?Y.Node addTarget событие не пузырится
var foo = Y.one(".foo"),
bar = Y.one(".bar");
foo.addTarget(bar);
foo.on("myEvent", function() {
//this log statement executes
Y.log("In foo listener");
});
bar.on("myEvent", function() {
//this log statement doesn't execute.
//I don't understand why. I think it
//should because I expect myEvent to
//bubble from foo to bar since I used
//addTarget
Y.log("In bar listener");
});
foo.fire("myEvent");
JS Fiddle: http://jsfiddle.net/steaks/tJnLf/
Спасибо! Я как раз собирался написать этот ответ. –