Fixed switchers for "Changing the color" and "Changing the language" guides (#3435)

* Update changing-the-language.md

* Update changing-the-colors.md

* Update changing-the-colors.md

* Update changing-the-language.md
This commit is contained in:
hafeoz 2022-01-06 09:26:20 +00:00 committed by GitHub
parent 5fa155d7fe
commit cbbef980dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -44,7 +44,7 @@ Click on a tile to change the color scheme:
button.addEventListener("click", function() { button.addEventListener("click", function() {
var attr = this.getAttribute("data-md-color-scheme") var attr = this.getAttribute("data-md-color-scheme")
document.body.setAttribute("data-md-color-scheme", attr) document.body.setAttribute("data-md-color-scheme", attr)
var name = document.querySelector("#__code_1 code span:nth-child(7)") var name = document.querySelector("#__code_1 code span.l")
name.textContent = attr name.textContent = attr
}) })
}) })
@ -99,7 +99,7 @@ Click on a tile to change the primary color:
button.addEventListener("click", function() { button.addEventListener("click", function() {
var attr = this.getAttribute("data-md-color-primary") var attr = this.getAttribute("data-md-color-primary")
document.body.setAttribute("data-md-color-primary", attr) document.body.setAttribute("data-md-color-primary", attr)
var name = document.querySelector("#__code_2 code span:nth-child(7)") var name = document.querySelector("#__code_2 code span.l")
name.textContent = attr.replace("-", " ") name.textContent = attr.replace("-", " ")
}) })
}) })
@ -156,7 +156,7 @@ Click on a tile to change the accent color:
button.addEventListener("click", function() { button.addEventListener("click", function() {
var attr = this.getAttribute("data-md-color-accent") var attr = this.getAttribute("data-md-color-accent")
document.body.setAttribute("data-md-color-accent", attr) document.body.setAttribute("data-md-color-accent", attr)
var name = document.querySelector("#__code_3 code span:nth-child(7)") var name = document.querySelector("#__code_3 code span.l")
name.textContent = attr.replace("-", " ") name.textContent = attr.replace("-", " ")
}) })
}) })

View File

@ -167,7 +167,7 @@ Click on a tile to change the directionality:
button.addEventListener("click", function() { button.addEventListener("click", function() {
var attr = this.getAttribute("data-md-dir") var attr = this.getAttribute("data-md-dir")
document.body.dir = attr document.body.dir = attr
var name = document.querySelector("#__code_3 code span:nth-child(5)") var name = document.querySelector("#__code_3 code span.l")
name.textContent = attr name.textContent = attr
}) })
}) })