diff --git a/src/lib/directives/clickOutside.js b/src/lib/directives/clickOutside.js new file mode 100644 index 0000000..ccaa7de --- /dev/null +++ b/src/lib/directives/clickOutside.js @@ -0,0 +1,15 @@ +export default function clickOutside(node) { + const handleClick = (event) => { + if (node && !node.contains(event.target) && !event.defaultPrevented) { + node.dispatchEvent(new CustomEvent('click_outside', node)); + } + }; + + document.addEventListener('click', handleClick, true); + + return { + destroy() { + document.removeEventListener('click', handleClick, true); + }, + }; +} diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 9d64f03..285837c 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -2,16 +2,19 @@ Ottawa board games, trades and sales
+
+ + diff --git a/src/routes/about/+page.svelte b/src/routes/about/+page.svelte index fbe1276..624a567 100644 --- a/src/routes/about/+page.svelte +++ b/src/routes/about/+page.svelte @@ -1,12 +1,3 @@ -
- -
-

bgg.babyl.ca is an aggregation of board games for sale or diff --git a/src/routes/stats/+page.svelte b/src/routes/stats/+page.svelte index d7f5499..587ebb3 100644 --- a/src/routes/stats/+page.svelte +++ b/src/routes/stats/+page.svelte @@ -1,12 +1,3 @@ -

- -
-

Currently listing {nbr_games} games from {nbr_sellers} sellers.

@@ -27,7 +18,6 @@