1
0

use history.replaceState if available

This commit is contained in:
Alexander Tumin
2022-06-19 18:13:14 +03:00
parent 7e57370881
commit ac097ab4b1
+5 -1
View File
@@ -157,7 +157,11 @@
<script type="application/javascript">
function searchfilter() {
const value = document.getElementById('searchinput').value;
window.location.hash = '#' + value;
if (history &amp;&amp; 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; }'
: '';