Skip to content

Instantly share code, notes, and snippets.

@rblalock
Created August 4, 2011 19:18
Show Gist options
  • Select an option

  • Save rblalock/1125985 to your computer and use it in GitHub Desktop.

Select an option

Save rblalock/1125985 to your computer and use it in GitHub Desktop.
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