[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Ricardo Wurmus |
Date: |
Tue, 26 Mar 2024 07:10:47 -0400 (EDT) |
branch: main
commit 305a7c0f3df638cff08a2ba9159ba204770b62ad
Author: Ricardo Wurmus <rekado@elephly.net>
AuthorDate: Tue Mar 26 12:08:17 2024 +0100
js: Only evaluate dependency collapse code if button exists.
We no longer use bootstrap js for collapsing elements. Luckily we can
easily
avoid an error here by only evaluating this legacy code when the collapse
button exists.
* src/static/js/cuirass.js: Add condition around use of collapse.
---
src/static/js/cuirass.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/static/js/cuirass.js b/src/static/js/cuirass.js
index b854671..4054256 100644
--- a/src/static/js/cuirass.js
+++ b/src/static/js/cuirass.js
@@ -102,7 +102,7 @@ ready(() => {
var dependencies = document.querySelector('.dependencies'),
collapse_dep_btn = document.querySelector('#collapse-dep-btn');
- if (dependencies !== null) {
+ if ((dependencies !== null) && (collapse_dep_btn !== null)) {
// TODO: replace collapse with details/summary
dependencies.collapse({ toggle: false });
dependencies.addEventListener('hide.bs.collapse', (e) =>