Created
November 11, 2012 03:48
-
-
Save hgezim/4053581 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
TeamDoListRouter = Backbone.Router.extend | |
initialize: (options) -> | |
# IMPORTANT: These get matched in the reverse order that they show up | |
@route(/\?*/, "home") #Match / followed by a question mark or 0 question marks | |
@route(/([a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12})/, "list") # Match a GUID | |
home: () -> | |
Session.set('page', 'home') | |
initHome() | |
this.navigate '' | |
list: (list_id) -> | |
Session.set('page', 'list') | |
Session.set("list_id", list_id) | |
initList() | |
this.navigate list_id, true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment