mirror of
https://github.com/VueTorrent/VueTorrent.git
synced 2024-11-25 10:55:50 +03:00
feat: open addmodal when dragging a file into the dashboard
This commit is contained in:
parent
011a5bdcf5
commit
5807db5e99
2 changed files with 13 additions and 3 deletions
|
@ -2,6 +2,7 @@
|
|||
<v-dialog
|
||||
v-model="dialog"
|
||||
scrollable
|
||||
:transition="dTransition"
|
||||
:content-class="phoneLayout ? 'rounded-0' : 'rounded-form'"
|
||||
max-width="500px"
|
||||
:fullscreen="phoneLayout"
|
||||
|
@ -201,9 +202,11 @@ import { FullScreenModal } from '@/mixins'
|
|||
export default {
|
||||
name: 'AddModal',
|
||||
mixins: [Modal, FullScreenModal],
|
||||
props: ['initialMagnet'],
|
||||
props: ['initialMagnet', 'openSuddenly'],
|
||||
data() {
|
||||
return {
|
||||
dTransition: 'scale-transition',
|
||||
hndlDialog: true,
|
||||
showWrapDrag: false,
|
||||
files: [],
|
||||
category: null,
|
||||
|
@ -253,6 +256,12 @@ export default {
|
|||
this.$store.commit('FETCH_CATEGORIES')
|
||||
this.urls = this.initialMagnet
|
||||
this.setSettings()
|
||||
if (this.openSuddenly == true) {
|
||||
this.dTransition = 'none'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.dTransition = 'scale-transition'
|
||||
},
|
||||
methods: {
|
||||
setSettings() {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<template>
|
||||
<div
|
||||
class="px-1 px-sm-5 pt-4 background noselect"
|
||||
@dragenter.prevent="detectDragEnter()"
|
||||
@click.self="resetSelected"
|
||||
>
|
||||
<v-row
|
||||
|
@ -294,6 +293,7 @@ export default {
|
|||
},
|
||||
mounted() {
|
||||
document.addEventListener('keydown', this.handleKeyboardShortcut)
|
||||
document.addEventListener('dragenter', this.detectDragEnter)
|
||||
},
|
||||
created() {
|
||||
this.$store.dispatch('INIT_INTERVALS')
|
||||
|
@ -302,6 +302,7 @@ export default {
|
|||
beforeDestroy() {
|
||||
this.$store.commit('REMOVE_INTERVALS')
|
||||
document.removeEventListener('keydown', this.handleKeyboardShortcut)
|
||||
document.removeEventListener('dragenter', this.detectDragEnter)
|
||||
},
|
||||
methods: {
|
||||
strTouchStart(e, data) {
|
||||
|
@ -354,7 +355,7 @@ export default {
|
|||
},
|
||||
detectDragEnter() {
|
||||
if (this.selected_torrents.length == 0 && this.$store.state.modals.length < 1) {
|
||||
this.addModal('AddModal')
|
||||
this.createModal('AddModal', { openSuddenly: true })
|
||||
}
|
||||
|
||||
return true
|
||||
|
|
Loading…
Reference in a new issue