Skip to content

Instantly share code, notes, and snippets.

@jtsternberg
Created November 21, 2018 21:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jtsternberg/9ee362895f91b8d856ee40cd24a9cd05 to your computer and use it in GitHub Desktop.
Save jtsternberg/9ee362895f91b8d856ee40cd24a9cd05 to your computer and use it in GitHub Desktop.
On OM redirect action, append any existing query args to the redirect url
document.addEventListener('om.Action.redirect', function(evt) {
var action = evt.detail.Action;
// Take existing url and append any query args on current url.
action.options.url += ( action.options.url.indexOf('?') > -1 ? '&' : '?' ) + window.location.search.substr(1);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment