]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Fix console error in examples pages du to no theme switcher (#38074)
authorJulien Déramond <julien.deramond@orange.com>
Fri, 17 Feb 2023 06:56:30 +0000 (07:56 +0100)
committerGitHub <noreply@github.com>
Fri, 17 Feb 2023 06:56:30 +0000 (08:56 +0200)
site/static/docs/5.3/assets/js/color-modes.js

index 68717f82d6e9cbe434ab46adba8d0fe77f75e2c6..4528ba36b846ef68ee4b6af8460064b9f286f78a 100644 (file)
 
   const showActiveTheme = (theme, focus = false) => {
     const themeSwitcher = document.querySelector('#bd-theme')
+
+    if (!themeSwitcher) {
+      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}"]`)