From 43017287e2a18177b1b0bbde65f695f16c5b984b Mon Sep 17 00:00:00 2001
From: weru <fromweru@gmail.com>
Date: Sun, 02 May 2021 15:52:30 +0000
Subject: [PATCH] add conditional
---
assets/js/code.js | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/assets/js/code.js b/assets/js/code.js
index 3a42552..fdb10f3 100644
--- a/assets/js/code.js
+++ b/assets/js/code.js
@@ -158,11 +158,13 @@
}
function toggleLineNumbers(elems) {
- elems.forEach(function (elem, index) {
- // mark the code element when there are no lines
- modifyClass(elem, 'pre_nolines')
- });
- restrainCodeBlockHeight(elems);
+ if(elems) {
+ elems.forEach(function (elem, index) {
+ // mark the code element when there are no lines
+ modifyClass(elem, 'pre_nolines')
+ });
+ restrainCodeBlockHeight(elems);
+ }
}
function toggleLineWrap(elem) {
--
Gitblit v1.10.0