diff options
| author | “Ryder <“r@okfoc.us”> | 2016-03-29 15:37:38 -0400 |
|---|---|---|
| committer | “Ryder <“r@okfoc.us”> | 2016-03-29 15:37:38 -0400 |
| commit | 6b84198c7c3eeadec90c8a856218c96acf942e45 (patch) | |
| tree | 53bc6a98227290ea3bf956484b7b0fa6dcdcaa4c /public/assets/js/lib/SiteRouter.js | |
| parent | 4fc13cd098f25904acba98d25b03cc777a5d85e8 (diff) | |
| parent | e19b1cd730e943ef5b2072f55026ae260c312ee8 (diff) | |
Merge branch 'master' of https://github.com/okfocus/portfolio
Diffstat (limited to 'public/assets/js/lib/SiteRouter.js')
| -rw-r--r-- | public/assets/js/lib/SiteRouter.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/public/assets/js/lib/SiteRouter.js b/public/assets/js/lib/SiteRouter.js new file mode 100644 index 0000000..7f1cec6 --- /dev/null +++ b/public/assets/js/lib/SiteRouter.js @@ -0,0 +1,31 @@ +var SiteRouter = Router.extend({ + + el: 'body', + routeByHash: false, + + routes: { + '/': 'home', + '/page/:id': 'project', + '/project/:id': 'project', + }, + + initial_route: null, + launch: function(){ + if (this.initial_route) { + this.parseRoute( this.initial_route ) + } + else { + this.route() + } + this.initial_route = null + }, + + home: function(){ + app.nav.pick("cover") + }, + + project: function(id){ + app.nav.pick(id) + }, + +})
\ No newline at end of file |
