66 :class =" [{ current: isCurrent() }, { contexton: context_menu_showing }]"
77 @dblclick.prevent =" emitUpdate"
88 @contextmenu.prevent =" showMenu"
9- @dragstart =" (e) => showDragStart(e, track, (index as number) - 1 , source)"
10- @dragend.prevent =" showDragEnd"
11- draggable =" true"
129 >
13- <div
14- v-if =" droppable"
15- class =" top-drop"
16- :class =" { active: dropTop }"
17- @dragenter ="
18- dropTop = true;
19- dropBottom = false;
20- "
21- @dragleave =" dropTop = false"
22- @dragover.prevent
23- @drop =" (e) => dropHere(e, true)"
24- ></div >
25- <div
26- v-if =" droppable && is_last"
27- class =" bottom-drop"
28- :class =" { active: dropBottom }"
29- @dragenter ="
30- dropBottom = true;
31- dropTop = false;
32- "
33- @dragleave =" dropBottom = false"
34- @dragover.prevent
35- @drop =" (e) => dropHere(e, false)"
36- ></div >
3710 <div
3811 class =" index t-center ellip"
3912 @click.prevent =" addToFav(track.trackhash)"
@@ -107,17 +80,13 @@ import { paths } from "@/config";
10780import { Track } from " @/interfaces" ;
10881import useQueueStore from " @/stores/queue" ;
10982import { formatSeconds } from " @/utils" ;
110- import { showDragStart , handleDrop } from " @/utils/songItemMethods" ;
11183
11284import OptionSvg from " @/assets/icons/more.svg" ;
11385import ArtistName from " ./ArtistName.vue" ;
11486import HeartSvg from " ./HeartSvg.vue" ;
11587import MasterFlag from " ./MasterFlag.vue" ;
11688import { dropSources } from " @/composables/enums" ;
11789
118- const dropTop = ref (false );
119- const dropBottom = ref (false );
120-
12190const imguri = paths .images .thumb .small ;
12291const context_menu_showing = ref (false );
12392const queue = useQueueStore ();
@@ -132,8 +101,6 @@ const props = defineProps<{
132101 source: dropSources ;
133102}>();
134103
135- // -------------
136-
137104const is_fav = ref (props .track .is_favorite );
138105
139106const emit = defineEmits <{
@@ -151,29 +118,6 @@ function emitUpdate() {
151118 emit (" playThis" );
152119}
153120
154- // ==== DRAG AND DROP ==== //
155- function resetFlags() {
156- dropTop .value = false ;
157- dropBottom .value = false ;
158- }
159-
160- function showDragEnd(e : DragEvent ) {
161- resetFlags ();
162- }
163-
164- function dropHere(e : DragEvent , top : boolean ) {
165- e .preventDefault ();
166- resetFlags ();
167-
168- const dropData = handleDrop (e , props .index as number , top );
169- if (! dropData ) return ;
170-
171- const { track, newIndex, oldIndex } = dropData ;
172- emit (" trackDropped" , props .source , track , newIndex , oldIndex );
173- }
174-
175- // ==== DRAG AND DROP END ==== //
176-
177121function showMenu(e : MouseEvent ) {
178122 showContext (e , props .track , context_menu_showing );
179123}
0 commit comments