Skip to content

Commit

Permalink
regex fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dnoneill committed Jan 5, 2021
1 parent ccd92f6 commit c7e748c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion build/custom-search.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion demo/dist/custom-search.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion js/lunr.custom.search.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,9 @@ function loadsearchtemplate(settings){

function changeSort(event) {
var site_url = window.location.origin + window.location.pathname;
const regex = /[?&]sort=?[^&]+(&)?/gm;
const regex = /([?&]sort=?[^&]+)/gm;
var window_url = window.location.search.replace(regex, "")
console.log(window_url)
sort_type = $(event.target).find("option:selected").val()
window.location = site_url + window_url + "&sort=" + sort_type
};
Expand Down

0 comments on commit c7e748c

Please sign in to comment.