vuefilemanager v1.4-beta.1

This commit is contained in:
carodej
2020-04-30 10:55:36 +02:00
parent 968b12c4ac
commit 606c1895a9
16 changed files with 275 additions and 32 deletions

View File

@@ -70,7 +70,8 @@
</div>
</div>
<span @click.stop="showItemActions" class="show-actions" v-if="$isMobile() && ! ( $checkPermission('visitor') && isFolder )">
<span @click.stop="showItemActions" class="show-actions"
v-if="$isMobile() && ! ( $checkPermission('visitor') && isFolder ) && canShowMobileOptions">
<FontAwesomeIcon icon="ellipsis-h" class="icon-action"></FontAwesomeIcon>
</span>
</div>
@@ -87,7 +88,7 @@
props: ['data'],
computed: {
...mapGetters([
'FilePreviewType', 'sharedDetail'
'FilePreviewType', 'sharedDetail', 'contextMenu'
]),
isFolder() {
return this.data.type === 'folder'
@@ -102,7 +103,10 @@
return !this.$isMobile()
&& !this.$isThisLocation(['trash', 'trash-root'])
&& !this.$checkPermission('visitor')
&& (this.sharedDetail && this.sharedDetail.type !== 'file')
&& !(this.sharedDetail && this.sharedDetail.type === 'file')
},
canShowMobileOptions() {
return ! (this.sharedDetail && this.sharedDetail.type === 'file')
},
canDrag() {
return !this.isDeleted && this.$checkPermission(['master', 'editor'])
@@ -194,7 +198,7 @@
renameItem: debounce(function (e) {
// Prevent submit empty string
if (e.target.innerText === '') return
if (e.target.innerText.trim() === '') return
this.$store.dispatch('renameItem', {
unique_id: this.data.unique_id,
@@ -286,6 +290,7 @@
max-height: 40px;
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
&[contenteditable] {
-webkit-user-select: text;

View File

@@ -99,10 +99,13 @@
return this.data.type === 'image'
},
canEditName() {
return ! this.$isMobile() && ! this.$isThisLocation(['trash', 'trash-root']) && ! this.$checkPermission('visitor')
return !this.$isMobile()
&& !this.$isThisLocation(['trash', 'trash-root'])
&& !this.$checkPermission('visitor')
&& !(this.sharedDetail && this.sharedDetail.type === 'file')
},
canDrag() {
return ! this.isDeleted && this.$checkPermission(['master', 'editor'])
return !this.isDeleted && this.$checkPermission(['master', 'editor'])
},
timeStamp() {
return this.data.deleted_at ? this.$t('item_thumbnail.deleted_at', {time: this.data.deleted_at}) : this.data.created_at
@@ -160,7 +163,7 @@
if (this.$isMobile() && this.isFolder) {
// Go to folder
if ( this.$isThisLocation('public') ) {
if (this.$isThisLocation('public')) {
this.$store.dispatch('browseShared', [this.data, false])
} else {
this.$store.dispatch('getFolder', [this.data, false])
@@ -190,7 +193,7 @@
if (this.isFolder) {
if ( this.$isThisLocation('public') ) {
if (this.$isThisLocation('public')) {
this.$store.dispatch('browseShared', [this.data, false])
} else {
this.$store.dispatch('getFolder', [this.data, false])