migrate: switch to callbacks instead of events
This commit is contained in:
1 parent
c7e2963390
commit
b291aeebf8
67 files changed
+332
-357
No files matched your search
@@ -67,7 +67,7 @@
|
||||
color="tertiary"
|
||||
rounding="pill"
|
||||
class="text-slate-700 dark:text-zinc-300"
|
||||
on:click={() => (replying = !replying)}
|
||||
onclick={() => (replying = !replying)}
|
||||
disabled={comment.post.locked || disabled}
|
||||
>
|
||||
<Icon src={ChatBubbleOvalLeft} size="14" micro />
|
||||
@@ -92,7 +92,7 @@
|
||||
{/snippet}
|
||||
<MenuDivider>{$t('comment.actions.label')}</MenuDivider>
|
||||
<MenuButton
|
||||
on:click={() => {
|
||||
onclick={() => {
|
||||
navigator.share?.({
|
||||
url: comment.comment.ap_id,
|
||||
}) ?? navigator.clipboard.writeText(comment.comment.ap_id)
|
||||
@@ -103,7 +103,7 @@
|
||||
</MenuButton>
|
||||
{#if settings.translator}
|
||||
<MenuButton
|
||||
on:click={() => {
|
||||
onclick={() => {
|
||||
// @ts-ignore
|
||||
text.set(comment.comment.content)
|
||||
translating = !translating
|
||||
@@ -117,13 +117,13 @@
|
||||
{/if}
|
||||
{#if $profile?.jwt}
|
||||
{#if comment.creator.id == $profile.user?.local_user_view.person.id}
|
||||
<MenuButton on:click={() => dispatcher('edit', comment)}>
|
||||
<MenuButton onclick={() => dispatcher('edit', comment)}>
|
||||
<Icon src={PencilSquare} mini size="16" />
|
||||
<span>{$t('post.actions.more.edit')}</span>
|
||||
</MenuButton>
|
||||
{/if}
|
||||
<MenuButton
|
||||
on:click={async () => {
|
||||
onclick={async () => {
|
||||
if ($profile?.jwt)
|
||||
comment.saved = await save(comment, !comment.saved, $profile.jwt)
|
||||
}}
|
||||
@@ -136,7 +136,7 @@
|
||||
{#if $profile?.user && $profile.jwt && $profile.user.local_user_view.person.id == comment.creator.id}
|
||||
<MenuButton
|
||||
color="danger-subtle"
|
||||
on:click={async () => {
|
||||
onclick={async () => {
|
||||
if ($profile?.jwt)
|
||||
comment.comment.deleted = await deleteItem(
|
||||
comment,
|
||||
@@ -154,7 +154,7 @@
|
||||
</MenuButton>
|
||||
{/if}
|
||||
{#if $profile.jwt && $profile.user?.local_user_view.person.id != comment.creator.id}
|
||||
<MenuButton on:click={() => report(comment)} color="danger-subtle">
|
||||
<MenuButton onclick={() => report(comment)} color="danger-subtle">
|
||||
<Icon src={Flag} mini size="16" />
|
||||
<span>{$t('moderation.report')}</span>
|
||||
</MenuButton>
|
||||
|
||||
@@ -106,7 +106,7 @@
|
||||
<Button
|
||||
size="custom"
|
||||
title={$t('common.cancel')}
|
||||
on:click={() => dispatch('cancel', true)}
|
||||
onclick={() => dispatch('cancel', true)}
|
||||
color="tertiary"
|
||||
class="w-8 h-8"
|
||||
rounding="xl"
|
||||
@@ -114,7 +114,7 @@
|
||||
<Icon src={XMark} size="16" micro />
|
||||
</Button>
|
||||
<Button
|
||||
on:click={submit}
|
||||
onclick={submit}
|
||||
color="primary"
|
||||
{loading}
|
||||
disabled={locked || loading || banned}
|
||||
|
||||
@@ -137,7 +137,7 @@
|
||||
color="tertiary"
|
||||
class="font-normal text-slate-600 dark:text-zinc-400"
|
||||
loaderWidth={16}
|
||||
on:click={() => {
|
||||
onclick={() => {
|
||||
if (node.depth > 4) {
|
||||
goto(
|
||||
`/comment/${$page.params.instance}/${node.comment_view.comment.id}#comments`,
|
||||
|
||||
Reference in new issue
Block a user