mirror of
https://github.com/konvajs/konva.git
synced 2025-11-08 02:24:44 +08:00
in addition to Collection each() and apply(), I wanted to make it easier to attach event listeners to node collections, so I went with David Johansson's approach for whitelisting on() and off().
The difference now is that the on() and off() methods are dynamically added to the Collections prototype from Node, which acts as a wrapper around each()
This commit is contained in:
@@ -742,7 +742,7 @@ Test.prototype.tests = {
|
||||
|
||||
test(shapes.length === 2, 'shapes array should have 2 elements');
|
||||
var a = 0;
|
||||
shapes.apply('on', 'mouseover', function() {
|
||||
shapes.on('mouseover', function() {
|
||||
a++;
|
||||
});
|
||||
circle.simulate('mouseover');
|
||||
|
||||
Reference in New Issue
Block a user