mirror of
https://github.com/VueTorrent/VueTorrent.git
synced 2024-11-29 05:28:53 +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-dialog
|
||||||
v-model="dialog"
|
v-model="dialog"
|
||||||
scrollable
|
scrollable
|
||||||
|
:transition="dTransition"
|
||||||
:content-class="phoneLayout ? 'rounded-0' : 'rounded-form'"
|
:content-class="phoneLayout ? 'rounded-0' : 'rounded-form'"
|
||||||
max-width="500px"
|
max-width="500px"
|
||||||
:fullscreen="phoneLayout"
|
:fullscreen="phoneLayout"
|
||||||
|
@ -201,9 +202,11 @@ import { FullScreenModal } from '@/mixins'
|
||||||
export default {
|
export default {
|
||||||
name: 'AddModal',
|
name: 'AddModal',
|
||||||
mixins: [Modal, FullScreenModal],
|
mixins: [Modal, FullScreenModal],
|
||||||
props: ['initialMagnet'],
|
props: ['initialMagnet', 'openSuddenly'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
dTransition: 'scale-transition',
|
||||||
|
hndlDialog: true,
|
||||||
showWrapDrag: false,
|
showWrapDrag: false,
|
||||||
files: [],
|
files: [],
|
||||||
category: null,
|
category: null,
|
||||||
|
@ -253,6 +256,12 @@ export default {
|
||||||
this.$store.commit('FETCH_CATEGORIES')
|
this.$store.commit('FETCH_CATEGORIES')
|
||||||
this.urls = this.initialMagnet
|
this.urls = this.initialMagnet
|
||||||
this.setSettings()
|
this.setSettings()
|
||||||
|
if (this.openSuddenly == true) {
|
||||||
|
this.dTransition = 'none'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.dTransition = 'scale-transition'
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
setSettings() {
|
setSettings() {
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
class="px-1 px-sm-5 pt-4 background noselect"
|
class="px-1 px-sm-5 pt-4 background noselect"
|
||||||
@dragenter.prevent="detectDragEnter()"
|
|
||||||
@click.self="resetSelected"
|
@click.self="resetSelected"
|
||||||
>
|
>
|
||||||
<v-row
|
<v-row
|
||||||
|
@ -294,6 +293,7 @@ export default {
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
document.addEventListener('keydown', this.handleKeyboardShortcut)
|
document.addEventListener('keydown', this.handleKeyboardShortcut)
|
||||||
|
document.addEventListener('dragenter', this.detectDragEnter)
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.$store.dispatch('INIT_INTERVALS')
|
this.$store.dispatch('INIT_INTERVALS')
|
||||||
|
@ -302,6 +302,7 @@ export default {
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
this.$store.commit('REMOVE_INTERVALS')
|
this.$store.commit('REMOVE_INTERVALS')
|
||||||
document.removeEventListener('keydown', this.handleKeyboardShortcut)
|
document.removeEventListener('keydown', this.handleKeyboardShortcut)
|
||||||
|
document.removeEventListener('dragenter', this.detectDragEnter)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
strTouchStart(e, data) {
|
strTouchStart(e, data) {
|
||||||
|
@ -354,7 +355,7 @@ export default {
|
||||||
},
|
},
|
||||||
detectDragEnter() {
|
detectDragEnter() {
|
||||||
if (this.selected_torrents.length == 0 && this.$store.state.modals.length < 1) {
|
if (this.selected_torrents.length == 0 && this.$store.state.modals.length < 1) {
|
||||||
this.addModal('AddModal')
|
this.createModal('AddModal', { openSuddenly: true })
|
||||||
}
|
}
|
||||||
|
|
||||||
return true
|
return true
|
||||||
|
|
Loading…
Reference in a new issue