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:
ericdrowell
2012-09-25 13:38:36 -07:00
parent d522b9d9d0
commit ff926b34af
4 changed files with 129 additions and 96 deletions

View File

@@ -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');