Skip to content

Commit

Permalink
Merge pull request #316 from Chicago/iss115
Browse files Browse the repository at this point in the history
Fix for issue on sharing query links
  • Loading branch information
tomschenkjr authored Aug 7, 2017
2 parents cdc7155 + fb8693e commit ec29bc2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/js/ux/AdvancedSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -749,9 +749,9 @@ ogrid.AdvancedSearch = ogrid.Class.extend({

//register with browser history
if (query.geoFilter && query.geoFilter.boundary === '_map-extent') {
hasher.setHash("query?q=" + JSON.stringify(query).replace('#', encodeURIComponent('#')) + "&loc=" + this._getMapLocation() + "&run=" + autoexec + randomData);
hasher.setHash("query?q=" + JSON.stringify(query).replace(/#/g, encodeURIComponent('#')) + "&loc=" + this._getMapLocation() + "&run=" + autoexec + randomData);
} else {
hasher.setHash("query?q=" + JSON.stringify(query).replace('#', encodeURIComponent('#')) + "&run=" + autoexec + randomData);
hasher.setHash("query?q=" + JSON.stringify(query).replace(/#/g, encodeURIComponent('#')) + "&run=" + autoexec + randomData);
}
},

Expand Down
6 changes: 4 additions & 2 deletions src/js/ux/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,10 @@ ogrid.Main = ogrid.Class.extend({
}
console.log(o);

//#issue 115; replace hash here or we'll get an error
o.q = o.q.replace(encodeURIComponent('#'), "#");
var regex = new RegExp(encodeURIComponent('#'),'g');

//#issue 115; replace hash here or we'll get an error
o.q = o.q.replace(regex, '#');

me._loadQuery(
o.q,
Expand Down

0 comments on commit ec29bc2

Please sign in to comment.