Skip to content

Commit

Permalink
lor.js: race condition при замене якоря на ссылку
Browse files Browse the repository at this point in the history
+ попытка оптимизировать загрузку
  • Loading branch information
maxcom committed Sep 18, 2023
1 parent d7bb879 commit 9d8ab06
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/main/webapp/WEB-INF/jsp/head.jsp
Expand Up @@ -25,6 +25,7 @@
<html lang=ru>
<head>
<link rel="stylesheet" type="text/css" href="/${template.style}/combined.css?MAVEN_BUILD_TIMESTAMP">
<link rel="preload" href="/js/lor.js?MAVEN_BUILD_TIMESTAMP">

<link rel="yandex-tableau-widget" href="/manifest.json" />
<meta name="referrer" content="always">
Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/js/lor.js
Expand Up @@ -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
Expand Down

0 comments on commit 9d8ab06

Please sign in to comment.