Skip to content

Commit

Permalink
QA: #4045 - Separate the url from the arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
TheWitness committed Jun 4, 2023
1 parent 978c61e commit e3b2074
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions include/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -3436,12 +3436,14 @@ function applyGraphFilter() {
'&thumbnails=' + $('#thumbnails').is(':checked'));

/* replace myHref parameter for address bar update */
const urlParams = new URLSearchParams(myHref);
var urlParts = myHref.split('?');
var urlParams = new URLSearchParams(urlParts[1]);

urlParams.set('rfilter', base64_encode($('#rfilter').val()));
if (typeof $('#host_id').val() != 'undefined') {
urlParams.set('host_id', $('#host_id').val());
}
myHref = urlParams.toString();
myHref = urlParts[0]+ '?' + urlParams.toString();

closeDateFilters();

Expand Down Expand Up @@ -3474,6 +3476,7 @@ function cleanHeader(href) {
function pushState(myTitle, myHref) {
if (myHref.indexOf('nostate') < 0) {
if (statePushed == false) {
console.log('My Href:'+myHref);

This comment has been minimized.

Copy link
@netniV

netniV Jun 5, 2023

Member

Debug log, should be removed?

This comment has been minimized.

Copy link
@TheWitness

TheWitness Jun 5, 2023

Author Member

Yea, I removed it in a subsequent commit.

if (typeof window.history.pushState != 'undefined') {
var myObject = { Page: myTitle, Url: cleanHeader(myHref) };
window.history.pushState(myObject, myObject.Page, myObject.Url);
Expand Down

0 comments on commit e3b2074

Please sign in to comment.