|
|
@ -112,18 +112,15 @@ class app.Router
|
|
|
|
@triggerRoute 'notFound'
|
|
|
|
@triggerRoute 'notFound'
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
isRoot: ->
|
|
|
|
isIndex: ->
|
|
|
|
location.pathname is '/'
|
|
|
|
@context.path is '/' or (app.isSingleDoc() and @context?.entry?.isIndex())
|
|
|
|
|
|
|
|
|
|
|
|
isDocIndex: ->
|
|
|
|
|
|
|
|
@context and @context.doc and @context.entry is @context.doc.toEntry()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setInitialPath: ->
|
|
|
|
setInitialPath: ->
|
|
|
|
# Remove superfluous forward slashes at the beginning of the path
|
|
|
|
# Remove superfluous forward slashes at the beginning of the path
|
|
|
|
if (path = location.pathname.replace /^\/{2,}/g, '/') isnt location.pathname
|
|
|
|
if (path = location.pathname.replace /^\/{2,}/g, '/') isnt location.pathname
|
|
|
|
page.replace path + location.search + location.hash, null, true
|
|
|
|
page.replace path + location.search + location.hash, null, true
|
|
|
|
|
|
|
|
|
|
|
|
if @isRoot()
|
|
|
|
if location.pathname is '/'
|
|
|
|
if path = @getInitialPathFromHash()
|
|
|
|
if path = @getInitialPathFromHash()
|
|
|
|
page.replace path + location.search, null, true
|
|
|
|
page.replace path + location.search, null, true
|
|
|
|
else if path = @getInitialPathFromCookie()
|
|
|
|
else if path = @getInitialPathFromCookie()
|
|
|
|