mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-22 06:39:52 +00:00
Guard more in color-modes.js (#38235)
This commit is contained in:
parent
6a043d95fa
commit
474bf2aed1
@ -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')
|
||||
|
Loading…
x
Reference in New Issue
Block a user