From e683d4101d5f785f30c6851887f2b5a2b048ffd5 Mon Sep 17 00:00:00 2001 From: Terence Chan Zun Mun Date: Fri, 26 Jul 2024 14:04:57 +0800 Subject: [PATCH] fix: dropdown only for posts --- assets/js/main.js | 4 ++++ post.hbs | 35 ++++++++++++++++++----------------- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/assets/js/main.js b/assets/js/main.js index b1e01b24..e02387fd 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -619,6 +619,10 @@ function colourTags() { } function contentDropdown() { + var element = document.getElementById('content-dropdown-enable'); + if (typeof element == 'undefined' || element == null) { + return; + } $('div.single-content h2').each(function () { var $header = $(this); var $nextElement = $header.next(); diff --git a/post.hbs b/post.hbs index 53c234eb..49fc98bb 100644 --- a/post.hbs +++ b/post.hbs @@ -1,17 +1,18 @@ -{{!< default}} - -{{#contentFor "title"}}{{meta_title}}{{/contentFor}} - -
-
- {{#post}} - {{> content width="wide"}} - {{/post}} - {{#is "post"}} - {{#if @custom.show_related_posts}} - {{> related}} - {{/if}} - {{> comment}} - {{/is}} -
-
+{{!< default}} + +{{#contentFor "title"}}{{meta_title}}{{/contentFor}} + +
+
+ {{#post}} + {{> content width="wide"}} + {{/post}} + {{#is "post"}} +
+ {{#if @custom.show_related_posts}} + {{> related}} + {{/if}} + {{> comment}} + {{/is}} +
+