mirror of
https://github.com/coracle-social/coracle.git
synced 2024-09-18 19:23:40 +00:00
Fix fallthrough on user badge click on alerts page
This commit is contained in:
parent
7a3338eeaa
commit
94dc7b9195
@ -1,5 +1,6 @@
|
||||
<script>
|
||||
import {Link} from 'svelte-routing'
|
||||
import {killEvent} from 'src/util/html'
|
||||
|
||||
export let person
|
||||
</script>
|
||||
@ -7,7 +8,7 @@
|
||||
<Link
|
||||
to={`/people/${person.pubkey}/notes`}
|
||||
class="flex gap-2 items-center relative z-10"
|
||||
on:click={e => e.stopPropagation()}>
|
||||
on:click={killEvent}>
|
||||
<div
|
||||
class="overflow-hidden w-4 h-4 rounded-full bg-cover bg-center shrink-0 border border-solid border-white"
|
||||
style="background-image: url({person.picture})" />
|
||||
|
@ -3,6 +3,7 @@
|
||||
import {ellipsize, quantify} from 'hurdak/src/core'
|
||||
import Badge from "src/partials/Badge.svelte"
|
||||
import {formatTimestamp} from 'src/util/misc'
|
||||
import {killEvent} from 'src/util/html'
|
||||
import {modal} from 'src/state/app'
|
||||
|
||||
export let note
|
||||
@ -10,13 +11,13 @@
|
||||
let isOpen = false
|
||||
|
||||
const openPopover = e => {
|
||||
e.stopPropagation()
|
||||
killEvent(e)
|
||||
|
||||
isOpen = true
|
||||
}
|
||||
|
||||
const closePopover = e => {
|
||||
e.stopPropagation()
|
||||
killEvent(e)
|
||||
|
||||
isOpen = false
|
||||
}
|
||||
@ -33,6 +34,7 @@
|
||||
{#if isOpen}
|
||||
<div transition:fly={{y: 20}} class="fixed inset-0 z-10" on:click={closePopover} />
|
||||
<div
|
||||
on:click={killEvent}
|
||||
transition:fly={{y: 20}}
|
||||
class="absolute top-0 mt-8 py-2 px-4 rounded border border-solid border-medium
|
||||
bg-dark grid grid-cols-3 gap-y-2 gap-x-4 z-20">
|
||||
|
@ -68,3 +68,9 @@ export const escapeHtml = html => {
|
||||
|
||||
return div.innerHTML
|
||||
}
|
||||
|
||||
export const killEvent = e => {
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
e.stopImmediatePropagation()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user