aboutsummaryrefslogtreecommitdiff
path: root/site/static
diff options
context:
space:
mode:
authorXhmikosR <[email protected]>2023-03-14 20:30:11 +0200
committerGitHub <[email protected]>2023-03-14 20:30:11 +0200
commit474bf2aed1c03cf53e2d2c48b30c5e689dd9e6bc (patch)
tree614eeb858cdfeea2f4e7eaad365e6930a5209f33 /site/static
parent6a043d95faf6c3dca040162538d4fc7bd643f9d8 (diff)
downloadbootstrap-474bf2aed1c03cf53e2d2c48b30c5e689dd9e6bc.tar.xz
bootstrap-474bf2aed1c03cf53e2d2c48b30c5e689dd9e6bc.zip
Guard more in color-modes.js (#38235)
Diffstat (limited to 'site/static')
-rw-r--r--site/static/docs/5.3/assets/js/color-modes.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/site/static/docs/5.3/assets/js/color-modes.js b/site/static/docs/5.3/assets/js/color-modes.js
index 4528ba36b..541fcc21b 100644
--- a/site/static/docs/5.3/assets/js/color-modes.js
+++ b/site/static/docs/5.3/assets/js/color-modes.js
@@ -29,12 +29,12 @@
const showActiveTheme = (theme, focus = false) => {
const themeSwitcher = document.querySelector('#bd-theme')
+ const themeSwitcherText = document.querySelector('#bd-theme-text')
- if (!themeSwitcher) {
+ if (!themeSwitcher || !themeSwitcherText) {
return
}
- const themeSwitcherText = document.querySelector('#bd-theme-text')
const activeThemeIcon = document.querySelector('.theme-icon-active use')
const btnToActive = document.querySelector(`[data-bs-theme-value="${theme}"]`)
const svgOfActiveBtn = btnToActive.querySelector('svg use').getAttribute('href')