Showing the changes to assets/javascripts/app (1 of 2 files). Show all
Unified · Split
| @@ -112,18 +112,15 @@ class app.Router · 111 unmodified lines | |||
| 112 | @triggerRoute 'notFound' | 112 | @triggerRoute 'notFound' |
| 113 | return | 113 | return |
| 114 | 114 | ||
| 115 | isRoot: -> | 115 | isIndex: -> |
| 116 | location.pathname is '/' | 116 | @context.path is '/' or (app.isSingleDoc() and @context?.entry?.isIndex()) |
| 117 | |||
| 118 | isDocIndex: -> | ||
| 119 | @context and @context.doc and @context.entry is @context.doc.toEntry() | ||
| 120 | 117 | ||
| 121 | setInitialPath: -> | 118 | setInitialPath: -> |
| 122 | # Remove superfluous forward slashes at the beginning of the path | 119 | # Remove superfluous forward slashes at the beginning of the path |
| 123 | if (path = location.pathname.replace /^\/{2,}/g, '/') isnt location.pathname | 120 | if (path = location.pathname.replace /^\/{2,}/g, '/') isnt location.pathname |
| 124 | page.replace path + location.search + location.hash, null, true | 121 | page.replace path + location.search + location.hash, null, true |
| 125 | 122 | ||
| 126 | if @isRoot() | 123 | if location.pathname is '/' |
| 127 | if path = @getInitialPathFromHash() | 124 | if path = @getInitialPathFromHash() |
| 128 | page.replace path + location.search, null, true | 125 | page.replace path + location.search, null, true |
| 129 | else if path = @getInitialPathFromCookie() | 126 | else if path = @getInitialPathFromCookie() |