mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
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:
parent
5fa155d7fe
commit
cbbef980dc
@ -44,7 +44,7 @@ Click on a tile to change the color scheme:
|
||||
button.addEventListener("click", function() {
|
||||
var attr = this.getAttribute("data-md-color-scheme")
|
||||
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
|
||||
})
|
||||
})
|
||||
@ -99,7 +99,7 @@ Click on a tile to change the primary color:
|
||||
button.addEventListener("click", function() {
|
||||
var attr = this.getAttribute("data-md-color-primary")
|
||||
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("-", " ")
|
||||
})
|
||||
})
|
||||
@ -156,7 +156,7 @@ Click on a tile to change the accent color:
|
||||
button.addEventListener("click", function() {
|
||||
var attr = this.getAttribute("data-md-color-accent")
|
||||
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("-", " ")
|
||||
})
|
||||
})
|
||||
|
@ -167,7 +167,7 @@ Click on a tile to change the directionality:
|
||||
button.addEventListener("click", function() {
|
||||
var attr = this.getAttribute("data-md-dir")
|
||||
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
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user