Fix error in event.js which prevented attaching more than one responder for an event name/element combination. [#651 state:resolved] (Rob Lineweaver)
This commit is contained in:
parent
005f066f1a
commit
6f6b73cc75
@ -1,3 +1,5 @@
|
||||
* Fix error in event.js which prevented attaching more than one responder for an event name/element combination. [#651 state:resolved] (Rob Lineweaver)
|
||||
|
||||
* Do not sniff when testing for IE's proprietary mouseenter/mouseleave events support. Use more robust inference instead. (kangax)
|
||||
|
||||
* Use `Prototype.emptyFunction` consistently throughout unit tests. [#253 state:resolved] (Michael M Slusarz, John David Dalton, kangax)
|
||||
|
@ -109,6 +109,24 @@ new Test.Unit.Runner({
|
||||
span.fire("test:somethingElseHappened");
|
||||
this.assertEqual(2, count);
|
||||
},
|
||||
|
||||
testMultipleEventHandlersCanBeAddedAndRemovedFromAnElement: function() {
|
||||
var span = $("span"), count1 = 0, count2 = 0;
|
||||
var observer1 = function() { count1++ };
|
||||
var observer2 = function() { count2++ };
|
||||
|
||||
span.observe("test:somethingHappened", observer1);
|
||||
span.observe("test:somethingHappened", observer2);
|
||||
span.fire("test:somethingHappened");
|
||||
this.assertEqual(1, count1);
|
||||
this.assertEqual(1, count2);
|
||||
|
||||
span.stopObserving("test:somethingHappened", observer1);
|
||||
span.stopObserving("test:somethingHappened", observer2);
|
||||
span.fire("test:somethingHappened");
|
||||
this.assertEqual(1, count1);
|
||||
this.assertEqual(1, count2);
|
||||
},
|
||||
|
||||
testStopObservingWithoutArguments: function() {
|
||||
var span = $("span"), count = 0, observer = function() { count++ };
|
||||
|
Loading…
Reference in New Issue
Block a user