From 9d8ab068a11fc30b0a8ba999db15e33176fd9a09 Mon Sep 17 00:00:00 2001 From: Maxim Valyanskiy Date: Mon, 18 Sep 2023 20:54:08 +0300 Subject: [PATCH] =?UTF-8?q?lor.js:=20race=20condition=20=D0=BF=D1=80=D0=B8?= =?UTF-8?q?=20=D0=B7=D0=B0=D0=BC=D0=B5=D0=BD=D0=B5=20=D1=8F=D0=BA=D0=BE?= =?UTF-8?q?=D1=80=D1=8F=20=D0=BD=D0=B0=20=D1=81=D1=81=D1=8B=D0=BB=D0=BA?= =?UTF-8?q?=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit + попытка оптимизировать загрузку --- src/main/webapp/WEB-INF/jsp/head.jsp | 1 + src/main/webapp/js/lor.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/webapp/WEB-INF/jsp/head.jsp b/src/main/webapp/WEB-INF/jsp/head.jsp index aa95fd3db3..cfcf9f6ce7 100644 --- a/src/main/webapp/WEB-INF/jsp/head.jsp +++ b/src/main/webapp/WEB-INF/jsp/head.jsp @@ -25,6 +25,7 @@ + diff --git a/src/main/webapp/js/lor.js b/src/main/webapp/js/lor.js index 4d15673f50..719359421f 100644 --- a/src/main/webapp/js/lor.js +++ b/src/main/webapp/js/lor.js @@ -302,8 +302,8 @@ function replace_state() { // Yes, we are viewing a comment // exit if no such target - if (document.querySelector('article.msg:target') === null) return; - + if (document.getElementById(document.location.hash.substring(1)) === null) return; + var hash = document.location.hash.split('-'); if (parseInt(hash[1]) > 0) { // OK, comment ID is valid