Created
April 23, 2012 23:22
-
-
Save jhubert/2474499 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
Robots.Views.HomePage = Backbone.RobotView.extend | |
template: Handlebars.compile($('#t-home-page').html()) | |
events: | |
"click #dashboard-link" : "goDashboard" | |
initialize: -> | |
@render() | |
render: -> | |
console.log 'rendering homepage' | |
@$el.html(@template()) | |
this | |
goDashboard: -> | |
Robots.app.navigate('dashboard', { trigger : true }) |
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
Robots.Routers.Entries = Backbone.Router.extend | |
views: {} | |
routes: | |
'': 'showHomePage' | |
'dashboard': 'showDashboard' | |
showHomePage: -> | |
if views['showHomePage'] | |
views['showHomePage'].render() | |
else | |
views['showHomePage'] = new Robots.Views.HomePage() | |
showDashboard: -> | |
new Robots.Views.Dashboard() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment