diff --git a/_assets/src/components/Main.vue b/_assets/src/components/Main.vue index 526c46f8..cf0a8597 100644 --- a/_assets/src/components/Main.vue +++ b/_assets/src/components/Main.vue @@ -12,12 +12,12 @@ search - - - + + + - + @@ -120,6 +120,43 @@ export default { }, isEditor () { return this.req.kind === 'editor' && !this.loading + }, + showUpload () { + if (this.req.kind === 'editor') return false + return this.user.allowNew + }, + showDeleteButton () { + if (this.req.kind === 'listing') { + if (this.selectedCount === 0) { + return false + } + + return this.user.allowEdit + } + + return this.user.allowEdit + }, + showRenameButton () { + if (this.req.kind === 'listing') { + if (this.selectedCount === 1) { + return this.user.allowEdit + } + + return false + } + + return this.user.allowEdit + }, + showMoveButton () { + if (this.req.kind !== 'listing') { + return false + } + + if (this.selectedCount > 0) { + return this.user.allowEdit + } + + return false } }, data: function () { @@ -232,43 +269,6 @@ export default { }, openSearch () { this.$store.commit('showHover', 'search') - }, - showUpload: function () { - if (this.req.kind === 'editor') return false - return this.user.allowNew - }, - showDeleteButton: function () { - if (this.req.kind === 'listing') { - if (this.selectedCount === 0) { - return false - } - - return this.user.allowEdit - } - - return this.user.allowEdit - }, - showRenameButton: function () { - if (this.req.kind === 'listing') { - if (this.selectedCount === 1) { - return this.user.allowEdit - } - - return false - } - - return this.user.allowEdit - }, - showMoveButton: function () { - if (this.req.kind !== 'listing') { - return false - } - - if (this.selectedCount > 0) { - return this.user.allowEdit - } - - return false } } }