#468 - add extra buttons for status actions
This commit is contained in:
parent
80ef855a63
commit
9fc997500e
8 changed files with 118 additions and 68 deletions
|
@ -1,7 +1,7 @@
|
|||
import Attachment from '../attachment/attachment.vue'
|
||||
import FavoriteButton from '../favorite_button/favorite_button.vue'
|
||||
import RetweetButton from '../retweet_button/retweet_button.vue'
|
||||
import DeleteButton from '../delete_button/delete_button.vue'
|
||||
import ExtraButtons from '../extra_buttons/extra_buttons.vue'
|
||||
import PostStatusForm from '../post_status_form/post_status_form.vue'
|
||||
import UserCard from '../user_card/user_card.vue'
|
||||
import UserAvatar from '../user_avatar/user_avatar.vue'
|
||||
|
@ -280,7 +280,7 @@ const Status = {
|
|||
Attachment,
|
||||
FavoriteButton,
|
||||
RetweetButton,
|
||||
DeleteButton,
|
||||
ExtraButtons,
|
||||
PostStatusForm,
|
||||
UserCard,
|
||||
UserAvatar,
|
||||
|
@ -301,6 +301,12 @@ const Status = {
|
|||
return 'icon-globe'
|
||||
}
|
||||
},
|
||||
showError (error) {
|
||||
this.error = error
|
||||
setTimeout(() => {
|
||||
this.error = null
|
||||
}, 5000)
|
||||
},
|
||||
linkClicked (event) {
|
||||
let { target } = event
|
||||
if (target.tagName === 'SPAN') {
|
||||
|
@ -358,23 +364,6 @@ const Status = {
|
|||
this.expandingSubject = true
|
||||
}
|
||||
},
|
||||
pinStatus () {
|
||||
this.$store.state.api.backendInteractor.pinOwnStatus(this.status.id).then((status) => {
|
||||
if (status.error) {
|
||||
this.error = status.error
|
||||
setTimeout(() => {
|
||||
this.error = null
|
||||
}, 5000)
|
||||
} else {
|
||||
this.$store.dispatch('updatePinned', status)
|
||||
}
|
||||
})
|
||||
},
|
||||
unpinStatus () {
|
||||
this.$store.state.api.backendInteractor.unpinOwnStatus(this.status.id).then((status) => {
|
||||
this.$store.dispatch('updatePinned', status)
|
||||
})
|
||||
},
|
||||
replyEnter (id, event) {
|
||||
this.showPreview = true
|
||||
const targetId = id
|
||||
|
|
|
@ -16,9 +16,6 @@
|
|||
<div v-if="pinned" class="status-pin">
|
||||
<i class="fa icon-pin faint"></i>
|
||||
<span class="faint">Pinned</span>
|
||||
<div class="button-icon button-action-icon" v-if="status.pinned && ownStatus" @click.prevent="unpinStatus" title="Unpin">
|
||||
<i class="fa icon-cancel"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="retweet && !noHeading && !inConversation" :class="[repeaterClass, { highlighted: repeaterStyle }]" :style="[repeaterStyle]" class="media container retweet-info">
|
||||
<UserAvatar class="media-left" v-if="retweet" :betterShadow="betterShadow" :user="statusoid.user"/>
|
||||
|
@ -60,9 +57,6 @@
|
|||
<a :href="status.external_url" target="_blank" v-if="!status.is_local && !isPreview" class="source_url" title="Source">
|
||||
<i class="button-icon icon-link-ext-alt"></i>
|
||||
</a>
|
||||
<div class="button-icon button-action-icon" v-if="!status.pinned && ownStatus" @click.prevent="pinStatus" title="Pin">
|
||||
<i class="fa icon-pin"></i>
|
||||
</div>
|
||||
<div class="button-icon button-action-icon" v-if="expandable && !isPreview" @click.prevent="toggleExpanded" title="Expand">
|
||||
<i class="icon-plus-squared"></i>
|
||||
</div>
|
||||
|
@ -175,7 +169,7 @@
|
|||
</div>
|
||||
<retweet-button :visibility='status.visibility' :loggedIn='loggedIn' :status='status'></retweet-button>
|
||||
<favorite-button :loggedIn='loggedIn' :status='status'></favorite-button>
|
||||
<delete-button :status='status'></delete-button>
|
||||
<extra-buttons :status="status" @onError="showError"></extra-buttons>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue