From 6133da21d400c20455bf49229f7cf3d58309957f Mon Sep 17 00:00:00 2001 From: Joe <33972521+hnb-ku@users.noreply.github.com> Date: Sat, 9 Mar 2019 10:34:30 +0800 Subject: [PATCH] only create toc for topics ignore replies --- common/header.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/header.html b/common/header.html index 1a0d6f4..05aa12e 100644 --- a/common/header.html +++ b/common/header.html @@ -267,7 +267,11 @@ I18n.translations[I18n.currentLocale()].js.composer.contains_dtoc = I18n.t( $.fn.dtoc = $elem => { run.scheduleOnce("sync", () => { if ($elem.hasClass("d-editor-preview")) return; + if (!$elem.parents("article#post_1").length) return const dToc = $elem.find(`[data-theme-toc="true"]`); + + + if (!dToc.length) return this;