mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-22 00:07:03 +02:00
Have utilStringQs advance past any leading '?' or '#' characters
This lets us remove a bunch of substring(1) and +1 from the code.
This commit is contained in:
@@ -39,7 +39,7 @@ export function behaviorHash(context) {
|
||||
var center = map.center();
|
||||
var zoom = map.zoom();
|
||||
var precision = Math.max(0, Math.ceil(Math.log(zoom) / Math.LN2));
|
||||
var q = utilObjectOmit(utilStringQs(window.location.hash.substring(1)),
|
||||
var q = utilObjectOmit(utilStringQs(window.location.hash),
|
||||
['comment', 'source', 'hashtags', 'walkthrough']
|
||||
);
|
||||
var newParams = {};
|
||||
@@ -91,7 +91,7 @@ export function behaviorHash(context) {
|
||||
.on('hashchange.hash', hashchange);
|
||||
|
||||
if (window.location.hash) {
|
||||
var q = utilStringQs(window.location.hash.substring(1));
|
||||
var q = utilStringQs(window.location.hash);
|
||||
|
||||
if (q.id) {
|
||||
context.zoomToEntity(q.id.split(',')[0], !q.map);
|
||||
|
||||
Reference in New Issue
Block a user