[Pkg-javascript-commits] [dojo] 23/28: Fix emit events on 'window' and 'document' objects
David Prévot
taffit at moszumanska.debian.org
Thu Aug 21 17:39:48 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to annotated tag 1.8.6
in repository dojo.
commit 47c2126a5c9b1163e251fc02dd3e38defa8245eb
Author: Eduardo Matos <edu.de.matos at hotmail.com>
Date: Sat Jul 20 10:05:37 2013 -0300
Fix emit events on 'window' and 'document' objects
---
tests/on/on.js | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/tests/on/on.js b/tests/on/on.js
index c5aeecd..bb5c031 100644
--- a/tests/on/on.js
+++ b/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
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/dojo.git
More information about the Pkg-javascript-commits
mailing list