From 97d3bb4efb37823bc13d3ba1e417d3cfd6e5b4e0 Mon Sep 17 00:00:00 2001 From: xaoxuu Date: Fri, 9 Feb 2024 21:15:07 +0800 Subject: [PATCH] [opt] toc --- source/js/main.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/js/main.js b/source/js/main.js index 6abafdb..6a8b281 100644 --- a/source/js/main.js +++ b/source/js/main.js @@ -16,7 +16,7 @@ const util = { const hourCount = dateDiff / hour const minuteCount = dateDiff / minute - if (dayCount > 7) { + if (dayCount > 14) { result = null } else if (dayCount >= 1) { result = parseInt(dayCount) + ' ' + stellar.config.date_suffix.day @@ -159,10 +159,10 @@ const init = { }); }) }, - leftbar: () => { + sidebar: () => { stellar.jQuery(() => { $("#data-toc a.toc-link").click(function (e) { - l_body.classList.remove("leftbar"); + sidebar.dismiss(); }); }) }, @@ -210,7 +210,7 @@ const init = { // init init.toc() -init.leftbar() +init.sidebar() init.relativeDate(document.querySelectorAll('#post-meta time')) init.registerTabsTag()