Created
January 22, 2012 21:02
-
-
Save vilmibm/1658771 to your computer and use it in GitHub Desktop.
marimo event example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
medley_abuse_form.moderate = function() { | |
// AJAX for moderating a given object | |
this.emit('object_moderated'); | |
}; | |
medley_comments.render = function() { | |
// Render a template, put it on the page | |
this.on('object_moderated', function() { | |
this.refresh(); | |
}); | |
this.emit('comments_loaded'); | |
}; | |
// On can also listen for a list of events | |
yahoo_hp01_ad.render = function() { | |
this.on(['bundle_loaded', 'hp00_loaded'], function() { | |
// bundle is loaded, so we can process the ad | |
// needed to wait for hp00 to see if this widget | |
// should be centered | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment