Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jleppert
Created August 19, 2011 16:46
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 jleppert/1157301 to your computer and use it in GitHub Desktop.
Save jleppert/1157301 to your computer and use it in GitHub Desktop.
add widget from within another widget example
<script type="text/javascript">
// init the framework with the first widget on the page
extole.init({
host: 'playstation.net.ph',
widgets: [{
name: 'myfirstwidget',
lightBox: {
fixed: true,
modal: true
},
src: '/channel/example/first_widget.html',
autoLoad: true,
showOnLoad: true
}]
});
window.extoleAsync = {
// called after initial widgets (in this case 'myfirstwidget') have been setup
ready: function() {
// subscribe to widget:create message from myfirstwidget and create a new widget from a definition it supplies
// in the published message
extole.widgets('myfirstwidget').subscribe('widget:create', function(m) {
extole.addWidget(m.msg);
});
}
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment