Skip to content

Instantly share code, notes, and snippets.

@webOS101
Last active October 13, 2015 21:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webOS101/4261859 to your computer and use it in GitHub Desktop.
Save webOS101/4261859 to your computer and use it in GitHub Desktop.
Event Sample
<script>
new Subscriber().renderInto(document.body);
</script>
enyo.kind({
name: "MyKind",
handlers: { ontap: "mytap" },
events: { onMyEvent: "" },
content: "Click for the answer",
mytap: function() {
this.doMyEvent({ answer: 42 });
}
});
enyo.kind({
name: "Subscriber",
components: [ { kind: "MyKind", onMyEvent: "answered" }],
answered: function(inSender, inEvent) {
alert("The answer is: " + inEvent.answer);
return(true);
}
});
name: Event Sample
description: Sending and receiving events
authors:
- Roy Sutton
normalize_css: no
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment