replace hash to prevent unnecessary jumping when the user alrdy has a hash

master
Aevann 2023-09-29 07:50:42 +03:00
parent a92b99940c
commit 99fcbebff5
1 changed files with 4 additions and 1 deletions

View File

@ -644,6 +644,9 @@ if (screen_width <= 768) {
if (object) {
object.addEventListener('shown.bs.modal', function (e) {
if (location.hash)
location.replace(`${location.href.split('#')[0]}#m-${e.target.id}`);
else
location.hash = `m-${e.target.id}`;
});