Skip to content

Instantly share code, notes, and snippets.

@isaiahdw
Created December 27, 2011 20:21
Show Gist options
  • Save isaiahdw/1525014 to your computer and use it in GitHub Desktop.
Save isaiahdw/1525014 to your computer and use it in GitHub Desktop.
// Filename: router.js
define([
"backbone",
"views/optimization/index",
"views/dashboard/index",
"views/report/key_value_drivers",
"views/report/valuation",
"views/header/valuation"
], function (
Backbone,
View_Optimization_Index,
View_Dashboard_Index,
View_Report_Key_Value_Drivers,
View_Report_Valuation,
View_Header_Valuation
) {
/**
* This isn't the normal way you do routing in backbone, but we don't
* need full routing, and don't want to use hashbangs to handle routing
* in IE.
*/
var initialize = function () {
new View_Header_Valuation()
.render();
var route = $("body").attr("id");
switch(route){
case "page_qb_main_dashboard":
new View_Dashboard_Index()
.render();
break;
case "page_qb_optimization_index":
new View_Optimization_Index()
.render();
break;
case "page_qb_report_valuation":
case "page_qb_report_pdf":
new View_Report_Valuation()
.render();
case "page_qb_report_key_value_drivers":
new View_Report_Key_Value_Drivers()
.render();
break;
}
};
return {
initialize: initialize
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment