fix draft dropdown
This commit is contained in:
parent
2097192469
commit
17d562b979
2 changed files with 23 additions and 13 deletions
|
@ -363,6 +363,12 @@ const PostStatusForm = {
|
|||
}
|
||||
},
|
||||
safeToSaveDraft () {
|
||||
console.log('safe', (
|
||||
this.newStatus.status ||
|
||||
this.newStatus.spoilerText ||
|
||||
this.newStatus.files?.length ||
|
||||
this.newStatus.hasPoll
|
||||
) && this.saveable)
|
||||
return (
|
||||
this.newStatus.status ||
|
||||
this.newStatus.spoilerText ||
|
||||
|
|
|
@ -334,22 +334,26 @@
|
|||
class="dropdown-menu"
|
||||
role="menu"
|
||||
>
|
||||
<button
|
||||
v-if="!hideDraft || !disableDraft"
|
||||
<div
|
||||
class="menu-item dropdown-item"
|
||||
role="menu"
|
||||
:disabled="!safeToSaveDraft && saveable"
|
||||
:class="{ disabled: !safeToSaveDraft }"
|
||||
@click.prevent="saveDraft"
|
||||
@click="close"
|
||||
>
|
||||
<template v-if="closeable">
|
||||
{{ $t('post_status.save_to_drafts_and_close_button') }}
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ $t('post_status.save_to_drafts_button') }}
|
||||
</template>
|
||||
</button>
|
||||
<button
|
||||
v-if="!hideDraft || !disableDraft"
|
||||
class="main-button"
|
||||
role="menu"
|
||||
:disabled="!safeToSaveDraft"
|
||||
@click.prevent="saveDraft"
|
||||
@click="close"
|
||||
>
|
||||
<template v-if="closeable">
|
||||
{{ $t('post_status.save_to_drafts_and_close_button') }}
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ $t('post_status.save_to_drafts_button') }}
|
||||
</template>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</Popover>
|
||||
|
|
Loading…
Add table
Reference in a new issue