Skip to content

Instantly share code, notes, and snippets.

@davidascher
Created August 8, 2013 04:18
Show Gist options
  • Select an option

  • Save davidascher/6181400 to your computer and use it in GitHub Desktop.

Select an option

Save davidascher/6181400 to your computer and use it in GitHub Desktop.
davida@suki ~/s/Ceci> git diff ceci.js
diff --git a/ceci.js b/ceci.js
index e9830f0..f6908e9 100644
--- a/ceci.js
+++ b/ceci.js
@@ -43,9 +43,8 @@ define(function() {
element.emit = function (data) {
element.channels.out.forEach(function(channel) {
- var customEvent = document.createEvent('CustomEvent');
- customEvent.initCustomEvent(getChannel(channel), {bubbles: true});
- customEvent.data = data;
+ var customEvent = CustomEvent(getChannel(channel), {bubbles: true,
+ detail: data})
element.dispatchEvent(customEvent);
console.log(element.id + " -> " + channel);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment