Admin & User account frontend consolidation

This commit is contained in:
Peter Papp
2021-03-15 16:56:26 +01:00
parent ba902a30b3
commit 803cc089bd
57 changed files with 472 additions and 726 deletions
@@ -37,7 +37,7 @@
<!--Name-->
<div class="item-name">
<b :ref="this.item.unique_id" @input="renameItem" @keydown.delete.stop @click.stop :contenteditable="canEditName" class="name">
<b :ref="this.item.id" @input="renameItem" @keydown.delete.stop @click.stop :contenteditable="canEditName" class="name">
{{ itemName }}
</b>
@@ -91,7 +91,7 @@ export default {
computed: {
...mapGetters(['FilePreviewType', 'fileInfoDetail', 'data']),
isClicked() {
return this.fileInfoDetail.some(element => element.unique_id == this.item.unique_id)
return this.fileInfoDetail.some(element => element.id === this.item.id)
},
isFolder() {
return this.item.type === 'folder'
@@ -175,7 +175,7 @@ export default {
if ((e.ctrlKey || e.metaKey) && !e.shiftKey) {
// Click + Ctrl
if (this.fileInfoDetail.some(item => item.unique_id === this.item.unique_id)) {
if (this.fileInfoDetail.some(item => item.id === this.item.id)) {
this.$store.commit('REMOVE_ITEM_FILEINFO_DETAIL', this.item)
} else {
this.$store.commit('GET_FILEINFO_DETAIL', this.item)
@@ -209,6 +209,7 @@ export default {
}
if (!this.mobileMultiSelect && this.$isMobile()) {
// Open in mobile version on first click
if (this.$isMobile() && this.isFolder) {
// Go to folder
@@ -228,17 +229,12 @@ export default {
}
if (this.mobileMultiSelect && this.$isMobile()) {
if (this.fileInfoDetail.some(item => item.unique_id === this.item.unique_id)) {
if (this.fileInfoDetail.some(item => item.id === this.item.id)) {
this.$store.commit('REMOVE_ITEM_FILEINFO_DETAIL', this.item)
} else {
this.$store.commit('GET_FILEINFO_DETAIL', this.item)
}
}
// Get target classname
let itemClass = e.target.className
if (['name', 'icon', 'file-link', 'file-icon-text'].includes(itemClass)) return
},
goToItem() {
if (this.isImage || this.isVideo || this.isAudio) {
@@ -249,7 +245,7 @@ export default {
} else if (this.isFolder) {
//Clear selected items after open another folder
// Clear selected items after open another folder
this.$store.commit('CLEAR_FILEINFO_DETAIL')
if (this.$isThisLocation('public')) {
@@ -264,7 +260,7 @@ export default {
if (e.target.innerText.trim() === '') return
this.$store.dispatch('renameItem', {
unique_id: this.item.unique_id,
id: this.item.id,
type: this.item.type,
name: e.target.innerText
})
@@ -274,10 +270,10 @@ export default {
this.itemName = this.item.name
events.$on('newFolder:focus', (unique_id) => {
events.$on('newFolder:focus', (id) => {
if(this.item.unique_id == unique_id && !this.$isMobile()) {
this.$refs[unique_id].focus()
if(this.item.id === id && !this.$isMobile()) {
this.$refs[id].focus()
document.execCommand('selectAll')
}
})
@@ -294,7 +290,7 @@ export default {
// Change item name
events.$on('change:name', (item) => {
if (this.item.unique_id == item.unique_id) this.itemName = item.name
if (this.item.id === item.id) this.itemName = item.name
})
}
}