Created
August 4, 2011 19:18
-
-
Save rblalock/1125985 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| var T$ = require('ti.layout'), | |
| http = require('ti.http'), | |
| dashboard = T$('#dashboard'), // dashboard layout | |
| news = T$('#news'); // news layout | |
| dashboard.bind({ | |
| windowTitle: 'Dashboard', | |
| itemOne : { title: 'Fish', image: 'somepic.png', uid: 'fish' }, | |
| itemTwo : { title: 'News', image: 'somepic.png', uid: 'news' }, | |
| itemThree : { title: 'Settings', image: 'somepic.png', uid: 'settings' } | |
| }); | |
| // click on the views of the dashboard | |
| dashboard.children('View').addEventListener('click', function(e) { | |
| // when the dashboard view is clicked, we'll open up the news layout and assume the JS file associated with that layout will know | |
| // what the e.uid is somewhere in it's context? Maybe in the open event listener in that JS file, it will get the callback args? | |
| news.open(e.uid); | |
| }); | |
| dashboard.open(); // open the dashboard layout first |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment