Created
August 19, 2011 16:46
-
-
Save jleppert/1157301 to your computer and use it in GitHub Desktop.
add widget from within another widget 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
<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