mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-18 08:12:15 +00:00
bug fixes
This commit is contained in:
@@ -48,7 +48,7 @@
|
||||
@input="changeItemName"
|
||||
:contenteditable="!$isMobile()"
|
||||
class="name"
|
||||
>{{ item.name }}</span
|
||||
>{{ itemName }}</span
|
||||
>
|
||||
|
||||
<!--Other attributes-->
|
||||
@@ -106,7 +106,7 @@
|
||||
return {
|
||||
isClicked: false,
|
||||
area: false,
|
||||
item: undefined
|
||||
itemName: undefined
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -126,6 +126,10 @@
|
||||
},
|
||||
clickedItem(e) {
|
||||
events.$emit('contextMenu:hide')
|
||||
events.$emit('fileItem:deselect')
|
||||
|
||||
// Set clicked item
|
||||
this.isClicked = true
|
||||
|
||||
// Open in mobile version on first click
|
||||
if (this.$isMobile() && this.isFolder) {
|
||||
@@ -165,6 +169,7 @@
|
||||
}
|
||||
},
|
||||
changeItemName: debounce(function (e) {
|
||||
|
||||
// Prevent submit empty string
|
||||
if (e.target.innerText === '') return
|
||||
|
||||
@@ -176,20 +181,17 @@
|
||||
}, 300)
|
||||
},
|
||||
created() {
|
||||
this.item = this.data
|
||||
|
||||
events.$on('fileItem:clicked', unique_id => {
|
||||
if (this.data.unique_id == unique_id) {
|
||||
this.isClicked = true
|
||||
} else {
|
||||
this.isClicked = false
|
||||
}
|
||||
})
|
||||
this.itemName = this.data.name
|
||||
|
||||
events.$on('fileItem:deselect', () => {
|
||||
// Deselect file
|
||||
this.isClicked = false
|
||||
})
|
||||
|
||||
// Change item name
|
||||
events.$on('change:name', (item) => {
|
||||
if (this.data.unique_id == item.unique_id) this.itemName = item.name
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user