diff --git a/frontend/js/commento.js b/frontend/js/commento.js index 7fdfd08..888c73d 100644 --- a/frontend/js/commento.js +++ b/frontend/js/commento.js @@ -1523,6 +1523,7 @@ attrSet(footer, "style", ""); nameWidthFix(); + loadHash(); } @@ -1570,6 +1571,19 @@ } + function loadHash() { + if (window.location.hash && window.location.hash.startsWith("#commento-")) { + var el = $(ID_CARD + window.location.hash.split("-")[1]); + if (el === null) { + return; + } + + classAdd(el, "highlighted"); + el.scrollIntoView(true); + } + } + + global.main = function(callback) { root = $(ID_ROOT); if (root === null) { diff --git a/frontend/sass/commento.scss b/frontend/sass/commento.scss index 3457f76..86bf54a 100644 --- a/frontend/sass/commento.scss +++ b/frontend/sass/commento.scss @@ -55,4 +55,8 @@ font-weight: 700; margin-top: 16px; } + + .commento-highlighted { + background: $yellow-0; + } }