Skip to content

Commit

Permalink
Fix error when calling Event.stopObserving(window). (jddalton) [#30 s…
Browse files Browse the repository at this point in the history
…tate:resolved]

(cherry picked from commit b94db72961fd11ed518758e284f7ab6584fd5187)
  • Loading branch information
savetheclocktower committed Apr 24, 2008
1 parent 92c32e7 commit eaaa09e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
* Fix error when calling Event.stopObserving(window). (jddalton) [#30 state:resolved]

* Fix an issue with calling Event.pointer before the DOM is loaded. (kangax, jddalton) [#4 state:resolved]

* Refactor unit tests. Unit tests are now dynamically generated from a JavaScript test file and optional HTML, JS and CSS fixtures. [Tobie Langel]
Expand Down
6 changes: 3 additions & 3 deletions src/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,13 +270,13 @@ Object.extend(Event, (function() {

if (!handler && eventName) {
getWrappersForEventName(id, eventName).each(function(wrapper) {
element.stopObserving(eventName, wrapper.handler);
Event.stopObserving(element, eventName, wrapper.handler);
});
return element;

} else if (!eventName) {
Object.keys(getCacheForID(id)).each(function(eventName) {
element.stopObserving(eventName);
Object.keys(getCacheForID(id)).without("element").each(function(eventName) {
Event.stopObserving(element, eventName);
});
return element;
}
Expand Down
2 changes: 2 additions & 0 deletions test/unit/event_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ new Test.Unit.Runner({
this.assertEqual(0, count);
span.fire("test:somethingElseHappened");
this.assertEqual(0, count);

this.assertEqual(window, Event.stopObserving(window));
},

testStopObservingWithoutHandlerArgument: function() {
Expand Down

0 comments on commit eaaa09e

Please sign in to comment.