Fix formatting

pull/6962/head
Nayan Gautam 5 years ago
parent 137ae2d81b
commit 44e8285ef2

@ -10,6 +10,6 @@ export function clickOutside(node) {
return { return {
destroy() { destroy() {
document.removeEventListener("click", handleClick, true); document.removeEventListener("click", handleClick, true);
}, }
}; };
}; }

@ -4,6 +4,13 @@
let showModal = true; let showModal = true;
</script> </script>
<button on:click={() => (showModal = true)}>Show Modal</button>
{#if showModal}
<div class="box" on:outclick={() => (showModal = false)}>
Click outside me!
</div>
{/if}
<style> <style>
.box { .box {
--width: 100px; --width: 100px;
@ -20,10 +27,3 @@
font-weight: bold; font-weight: bold;
} }
</style> </style>
<button on:click={() => (showModal = true)}>Show Modal</button>
{#if showModal}
<div class="box" on:outclick={() => (showModal = false)}>
Click outside me!
</div>
{/if}

@ -4,6 +4,6 @@ export function clickOutside(node) {
return { return {
destroy() { destroy() {
// ...cleanup goes here // ...cleanup goes here
}, }
}; };
}; }

@ -4,6 +4,13 @@
let showModal = true; let showModal = true;
</script> </script>
<button on:click={() => (showModal = true)}>Show Modal</button>
{#if showModal}
<div class="box" use:clickOutside on:outclick={() => (showModal = false)}>
Click outside me!
</div>
{/if}
<style> <style>
.box { .box {
--width: 100px; --width: 100px;
@ -20,10 +27,3 @@
font-weight: bold; font-weight: bold;
} }
</style> </style>
<button on:click={() => (showModal = true)}>Show Modal</button>
{#if showModal}
<div class="box" use:clickOutside on:outclick={() => (showModal = false)}>
Click outside me!
</div>
{/if}

@ -10,6 +10,6 @@ export function clickOutside(node) {
return { return {
destroy() { destroy() {
document.removeEventListener("click", handleClick, true); document.removeEventListener("click", handleClick, true);
}, }
}; };
}; }

Loading…
Cancel
Save