You've already forked filebrowser
mirror of
https://github.com/filebrowser/filebrowser.git
synced 2025-11-26 14:25:26 +08:00
Improvements :)
Former-commit-id: c1c1881302a241fdc7140e6aabeb9b49977bd7c6 [formerly 84bb454c2f34baffd9dfa91645b8aff149e52620] [formerly 29e258c7a16db1ca8a3fde7c5e4e3cffc47899a6 [formerly 84ddad027f]]
Former-commit-id: 0018a51df5bc801b783a3ffe17d9f33c504ce094 [formerly 0072c425cd4754e38f30007ab9f5272ea4b40370]
Former-commit-id: d298f006e58ef9e4987def4bc354818062b30fcd
This commit is contained in:
@@ -33,7 +33,10 @@ import array from '../array.js'
|
||||
|
||||
export default {
|
||||
name: 'item',
|
||||
props: ['name', 'isDir', 'url', 'type', 'size', 'modified', 'selected'],
|
||||
props: ['name', 'isDir', 'url', 'type', 'size', 'modified', 'index'],
|
||||
data: function () {
|
||||
return window.info.listing
|
||||
},
|
||||
methods: {
|
||||
icon: function () {
|
||||
if (this.isDir) return 'folder'
|
||||
@@ -97,22 +100,18 @@ export default {
|
||||
})
|
||||
|
||||
this.selected.length = 0
|
||||
|
||||
// listing.handleSelectionChange()
|
||||
return false
|
||||
},
|
||||
click: function (event) {
|
||||
let el = event.currentTarget
|
||||
|
||||
if (this.selected.length !== 0) event.preventDefault()
|
||||
if (this.selected.indexOf(el.id) === -1) {
|
||||
if (this.selected.indexOf(this.index) === -1) {
|
||||
if (!event.ctrlKey && !this.multiple) this.unselectAll()
|
||||
|
||||
el.setAttribute('aria-selected', true)
|
||||
this.selected.push(el.id)
|
||||
this.$el.setAttribute('aria-selected', true)
|
||||
this.selected.push(this.index)
|
||||
} else {
|
||||
el.setAttribute('aria-selected', false)
|
||||
this.selected = array.remove(this.selected, el.id)
|
||||
this.$el.setAttribute('aria-selected', false)
|
||||
this.selected = array.remove(this.selected, this.index)
|
||||
}
|
||||
|
||||
// this.handleSelectionChange()
|
||||
|
||||
Reference in New Issue
Block a user