Skip to content
Permalink
Browse files

Fix emit events on 'window' and 'document' objects

  • Loading branch information...
eduardo-matos authored and kriszyp committed Jul 20, 2013
1 parent 5a93bd3 commit 47c2126a5c9b1163e251fc02dd3e38defa8245eb
Showing with 12 additions and 0 deletions.
  1. +12 −0 tests/on/on.js
@@ -152,6 +152,18 @@ define([
signal.remove();
signal2.remove();

// make sure 'document' and 'window' can also emit events
var eventEmitted;
var globalObjects = [document, window];
for(var i = 0, len = globalObjects.length; i < len; i++) {
eventEmitted = false;
on(globalObjects[i], 'custom-test-event', function () {
eventEmitted = true;
});
on.emit(globalObjects[i], 'custom-test-event', {});
t.is(true, eventEmitted);
}

// test out event delegation
if(query){
// if dojo.query is loaded, test event delegation

0 comments on commit 47c2126

Please sign in to comment.
You can’t perform that action at this time.