Fixed endless redirect in palette change example

This commit is contained in:
squidfunk
2022-01-16 12:34:51 +01:00
parent f9e9418462
commit 749c19c4bc
3 changed files with 5 additions and 7 deletions

View File

@@ -56,9 +56,8 @@
/* 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)
location.reload()
ref.addEventListener("change", function() {
location.reload()
})
})
</script>