fix: 🐛 popup modal does not trigger when more than one button on page
This commit is contained in:
parent
1e3566bd95
commit
cbcac29561
1 changed files with 13 additions and 11 deletions
|
@ -1,16 +1,18 @@
|
||||||
<script>
|
<script>
|
||||||
const nsfwButton = document.querySelector('#nsfw-toggle');
|
const nsfwButtonBtns = document.querySelectorAll('.nsfw-toggle');
|
||||||
|
|
||||||
nsfwButton.addEventListener('click', () => {
|
nsfwButtonBtns.forEach((btn) =>
|
||||||
const isInHornyJail = storeProxy.getItem('isInHornyJail') === 'true';
|
btn.addEventListener('click', () => {
|
||||||
const isHorny = storeProxy.getItem('isHorny') === 'true';
|
const isInHornyJail = storeProxy.getItem('isInHornyJail') === 'true';
|
||||||
|
const isHorny = storeProxy.getItem('isHorny') === 'true';
|
||||||
|
|
||||||
if (isInHornyJail) {
|
if (isInHornyJail) {
|
||||||
storeProxy.setItem('isHorny', !isHorny);
|
storeProxy.setItem('isHorny', !isHorny);
|
||||||
} else {
|
} else {
|
||||||
open();
|
open();
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div webc:root="override">
|
<div webc:root="override">
|
||||||
|
@ -20,7 +22,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ref-button id="nsfw-toggle" command="show-modal" commandfor="nsfw-warning">
|
<ref-button class="nsfw-toggle" command="show-modal" commandfor="nsfw-warning">
|
||||||
Reveal/Hide
|
Reveal/Hide
|
||||||
</ref-button>
|
</ref-button>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue