refs #254 Add delete button in toot detail menu if toot is my toot

This commit is contained in:
AkiraFukushima 2018-04-30 21:33:12 +09:00
parent f5defe9629
commit f2477a4762

View File

@ -57,9 +57,11 @@
<li role="button" @click="copyLink(message)"> <li role="button" @click="copyLink(message)">
Copy Link to Toot Copy Link to Toot
</li> </li>
<li role="button" class="separate" @click="deleteToot(message)" v-if="isMyMessage(message)">
Delete
</li>
</ul> </ul>
</div> </div>
<el-button slot="reference" type="text"> <el-button slot="reference" type="text">
<icon name="ellipsis-h" scale="0.9"></icon> <icon name="ellipsis-h" scale="0.9"></icon>
</el-button> </el-button>
@ -224,6 +226,11 @@ export default {
return this.originalMessage(message).favourites_count return this.originalMessage(message).favourites_count
} }
return '' return ''
},
isMyMessage (message) {
return this.$store.state.TimelineSpace.account.accountId === this.originalMessage(message).account.id
},
deleteToot (message) {
} }
} }
} }
@ -350,10 +357,9 @@ function findLink (target) {
} }
.toot-menu { .toot-menu {
padding-right: 8px;
.menu-list { .menu-list {
padding: 0; padding: 0;
margin: 4px 0;
font-size: 0.8em; font-size: 0.8em;
list-style-type: none; list-style-type: none;
line-height: 20px; line-height: 20px;
@ -362,13 +368,19 @@ function findLink (target) {
li { li {
box-sizing: border-box; box-sizing: border-box;
padding-left: 0.5em; margin: 0;
padding-bottom: 0.5em; padding: 0 1.1em 0.5em;
&:hover { &:hover {
background-color: #f2f6fc; background-color: #f2f6fc;
cursor: pointer; cursor: pointer;
} }
&.separate {
border-top: 1px solid var(--theme-border-color);
padding-top: 4px;
margin-top: 2px;
}
} }
} }
} }