mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-21 05:09:15 +00:00
Simplify Navigation.go, not preserving hash fragments
I looked through the history and it looks like this function was a bit flawed (preserving hash fragments) from the beginning. It has been patched a few times without addressing the underlying issue that we want more than just replacing the pathname. We want to go somewhere else.
This commit is contained in:
@@ -21,10 +21,9 @@ Darkswarm.factory 'Navigation', ($location, $window) ->
|
||||
$window.location.href = $window.location.origin + path
|
||||
|
||||
go: (path)->
|
||||
if path.match /^http/
|
||||
$window.location.href = path
|
||||
else
|
||||
$window.location.pathname = path
|
||||
# The browser treats this like clicking on a link.
|
||||
# It works for absolute paths, relative paths and URLs alike.
|
||||
$window.location.href = path
|
||||
|
||||
reload: ->
|
||||
$window.location.reload()
|
||||
|
||||
Reference in New Issue
Block a user