Skip to content

Commit

Permalink
Rev2055, Don't add ? to url if start with # using replaceState and pu…
Browse files Browse the repository at this point in the history
…shState
  • Loading branch information
shortcutme committed May 6, 2017
1 parent e426319 commit 34a6337
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Config(object):

def __init__(self, argv):
self.version = "0.5.4"
self.rev = 2054
self.rev = 2055
self.argv = argv
self.action = None
self.config_file = "zeronet.conf"
Expand Down
4 changes: 3 additions & 1 deletion src/Ui/media/Wrapper.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ class Wrapper
back = window.location.pathname
if back.match /^\/[^\/]+$/ # Add / after site address if called without it
back += "/"
if query.replace("?", "")
if query.startsWith("#")
back = query
else if query.replace("?", "")
back += "?"+query.replace("?", "")
return back

Expand Down
4 changes: 3 additions & 1 deletion src/Ui/media/all.js
Original file line number Diff line number Diff line change
Expand Up @@ -1005,7 +1005,9 @@ jQuery.extend( jQuery.easing,
if (back.match(/^\/[^\/]+$/)) {
back += "/";
}
if (query.replace("?", "")) {
if (query.startsWith("#")) {
back = query;
} else if (query.replace("?", "")) {
back += "?" + query.replace("?", "");
}
return back;
Expand Down

0 comments on commit 34a6337

Please sign in to comment.