mirror of https://github.com/twbs/bootstrap.git
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 showActiveTheme = (theme, focus = false) => {
|
||||||
const themeSwitcher = document.querySelector('#bd-theme')
|
const themeSwitcher = document.querySelector('#bd-theme')
|
||||||
|
const themeSwitcherText = document.querySelector('#bd-theme-text')
|
||||||
|
|
||||||
if (!themeSwitcher) {
|
if (!themeSwitcher || !themeSwitcherText) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const themeSwitcherText = document.querySelector('#bd-theme-text')
|
|
||||||
const activeThemeIcon = document.querySelector('.theme-icon-active use')
|
const activeThemeIcon = document.querySelector('.theme-icon-active use')
|
||||||
const btnToActive = document.querySelector(`[data-bs-theme-value="${theme}"]`)
|
const btnToActive = document.querySelector(`[data-bs-theme-value="${theme}"]`)
|
||||||
const svgOfActiveBtn = btnToActive.querySelector('svg use').getAttribute('href')
|
const svgOfActiveBtn = btnToActive.querySelector('svg use').getAttribute('href')
|
||||||
|
|
Loading…
Reference in New Issue