mirror of
https://github.com/VueTorrent/VueTorrent.git
synced 2025-02-26 20:31:13 +03:00
improv: torrent select behavior
This commit is contained in:
parent
51fbec1324
commit
058f57e8b2
3 changed files with 7 additions and 6 deletions
|
@ -3,7 +3,7 @@
|
||||||
flat
|
flat
|
||||||
class="pointer noselect"
|
class="pointer noselect"
|
||||||
:class="{ selected: isSelected}"
|
:class="{ selected: isSelected}"
|
||||||
@click.native.prevent="selectMode && selectTorrent(torrent.hash)"
|
@click.native.exact.prevent="selectMode && selectTorrent(torrent.hash)"
|
||||||
@dblclick.prevent="showInfo(torrent.hash)"
|
@dblclick.prevent="showInfo(torrent.hash)"
|
||||||
@click.ctrl.exact.prevent="selectTorrent(torrent.hash)"
|
@click.ctrl.exact.prevent="selectTorrent(torrent.hash)"
|
||||||
@click.shift.exact.prevent="selectUntil(torrent.hash, index)"
|
@click.shift.exact.prevent="selectUntil(torrent.hash, index)"
|
||||||
|
@ -27,7 +27,8 @@ export default {
|
||||||
},
|
},
|
||||||
mixins: [General, TorrentSelect],
|
mixins: [General, TorrentSelect],
|
||||||
props: {
|
props: {
|
||||||
torrent: Object
|
torrent: Object,
|
||||||
|
index: Number
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['selected_torrents', 'selectMode']),
|
...mapState(['selected_torrents', 'selectMode']),
|
||||||
|
@ -41,4 +42,4 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -4,7 +4,7 @@ export default {
|
||||||
return this.$store.getters.containsTorrent(hash)
|
return this.$store.getters.containsTorrent(hash)
|
||||||
},
|
},
|
||||||
selectTorrent(hash) {
|
selectTorrent(hash) {
|
||||||
if (!this.$store.state.selectMode) return
|
if (!this.$store.state.selectMode) this.$store.state.selectMode = true
|
||||||
if (this.isAlreadySelected(hash)) {
|
if (this.isAlreadySelected(hash)) {
|
||||||
this.$store.commit('SET_SELECTED', { type: 'remove', hash })
|
this.$store.commit('SET_SELECTED', { type: 'remove', hash })
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -128,7 +128,7 @@
|
||||||
</v-card>
|
</v-card>
|
||||||
</v-expand-x-transition>
|
</v-expand-x-transition>
|
||||||
<v-list-item-content class="pa-0">
|
<v-list-item-content class="pa-0">
|
||||||
<Torrent :torrent="torrent" />
|
<Torrent :torrent="torrent" :index="index" />
|
||||||
<v-divider
|
<v-divider
|
||||||
v-if="index < paginatedData.length - 1"
|
v-if="index < paginatedData.length - 1"
|
||||||
:key="index"
|
:key="index"
|
||||||
|
@ -309,4 +309,4 @@ export default {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Add table
Reference in a new issue