use history.replaceState if available
This commit is contained in:
@@ -157,7 +157,11 @@
|
||||
<script type="application/javascript">
|
||||
function searchfilter() {
|
||||
const value = document.getElementById('searchinput').value;
|
||||
window.location.hash = '#' + value;
|
||||
if (history && history.replaceState) {
|
||||
history.replaceState(null, null, '#' + value);
|
||||
} else {
|
||||
window.location.hash = '#' + value;
|
||||
}
|
||||
document.getElementById('search').innerText = value
|
||||
? '.container > .element { display: none; } .container > .element[name*="' + value + '"] { display:inherit; }'
|
||||
: '';
|
||||
|
||||
Reference in New Issue
Block a user