fix(index): don't re-render posts on click
This commit is contained in:
parent
2a8c3194d1
commit
73f7d90fa6
1 changed files with 3 additions and 0 deletions
|
|
@ -56,6 +56,7 @@ let typing = false;
|
||||||
function typechars(e) {
|
function typechars(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
if (e.target.classList.contains("active")) return;
|
||||||
if (typing) return;
|
if (typing) return;
|
||||||
typing = true;
|
typing = true;
|
||||||
|
|
||||||
|
|
@ -119,6 +120,8 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||||
topic.addEventListener("click", (e) => {
|
topic.addEventListener("click", (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
if (topic.classList.contains("active")) return;
|
||||||
|
|
||||||
topics.forEach((t) => {
|
topics.forEach((t) => {
|
||||||
t.classList.remove("active");
|
t.classList.remove("active");
|
||||||
t.style.color = "";
|
t.style.color = "";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue