From 8e6061ff2c8e7aa0f901168ab6b05b12e95246d6 Mon Sep 17 00:00:00 2001
From: weru <fromweru@gmail.com>
Date: Tue, 06 Apr 2021 23:40:30 +0000
Subject: [PATCH] update helpers

---
 assets/js/code.js |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/assets/js/code.js b/assets/js/code.js
index 3088550..021d355 100644
--- a/assets/js/code.js
+++ b/assets/js/code.js
@@ -91,7 +91,7 @@
     if(lastLinePos !== 0) {
       maxCodeBlockHeight = `${lastLinePos}px`;
       const codeBlock = lines[0].parentNode;
-      const outerBlock = codeBlock.closest('.highlight');
+      const outerBlock = codeBlock.closest(`.${highlight}`);
       const isExpanded = containsClass(outerBlock, panelExpanded);
       if(!isExpanded) {
         codeBlock.dataset.height = maxCodeBlockHeight;
@@ -120,7 +120,7 @@
     pushClass(expandDot, panelFrom);
     expandDot.title = "Toggle code block expand";
     expandDot.textContent = "...";
-    const outerBlock = block.closest('.highlight');
+    const outerBlock = block.closest(`.${highlight}`);
     window.setTimeout(function(){
       const expandIcon = outerBlock.nextElementSibling.lastElementChild;
       deleteClass(expandIcon, panelHide);
@@ -220,8 +220,7 @@
     return target.matches(`.${id}`) || target.closest(`.${id}`);
   }
 
-  function showActive(target, targetClass,activeClass = 'active') {
-    const active = activeClass;
+  function showActive(target, targetClass) {
     const targetElement = target.matches(`.${targetClass}`) ? target : target.closest(`.${targetClass}`);
 
     deleteClass(targetElement, active);

--
Gitblit v1.10.0