mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Fixed endless redirect in palette change example
This commit is contained in:
parent
f9e9418462
commit
749c19c4bc
@ -71,8 +71,7 @@ calling the `super()` function at the beginning of the block:
|
||||
/* Register event handlers after documented loaded */
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
var ref = document.querySelector("[data-md-component=palette]")
|
||||
component$.subscribe(function (component) {
|
||||
if (component.ref === ref)
|
||||
ref.addEventListener("change", function() {
|
||||
location.reload()
|
||||
})
|
||||
})
|
||||
|
@ -6,5 +6,5 @@
|
||||
{{ super() }}
|
||||
<h2 id="__comments">{{ lang.t("meta.comments") }}</h2>
|
||||
<script src="https://giscus.app/client.js" data-repo="squidfunk/mkdocs-material" data-repo-id="MDEwOlJlcG9zaXRvcnk1MDYxNzQyOA==" data-category="_" data-category-id="DIC_kwDOAwRcVM4CAtJY" data-mapping="pathname" data-reactions-enabled="1" data-emit-metadata="1" data-theme="light" data-lang="en" crossorigin="anonymous" async></script>
|
||||
<script>var giscus,palette=__md_get("__palette");palette&&"object"==typeof palette.color&&"slate"===palette.color.scheme&&(giscus=document.querySelector("script[src*=giscus]")).setAttribute("data-theme","dark"),document.addEventListener("DOMContentLoaded",function(){var t=document.querySelector("[data-md-component=palette]");component$.subscribe(function(e){e.ref===t&&location.reload()})})</script>
|
||||
<script>var giscus,palette=__md_get("__palette");palette&&"object"==typeof palette.color&&"slate"===palette.color.scheme&&(giscus=document.querySelector("script[src*=giscus]")).setAttribute("data-theme","dark"),document.addEventListener("DOMContentLoaded",function(){document.querySelector("[data-md-component=palette]").addEventListener("change",function(){location.reload()})})</script>
|
||||
{% endblock %}
|
||||
|
@ -56,8 +56,7 @@
|
||||
/* Register event handlers after documented loaded */
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
var ref = document.querySelector("[data-md-component=palette]")
|
||||
component$.subscribe(function (component) {
|
||||
if (component.ref === ref)
|
||||
ref.addEventListener("change", function() {
|
||||
location.reload()
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user