A lot of things
This commit is contained in:
@@ -12,6 +12,8 @@ export function GalleryManager() {
|
||||
*/
|
||||
images: [],
|
||||
|
||||
dragSrcI: null,
|
||||
|
||||
/**
|
||||
* Forward to this.images.length
|
||||
* @returns {number}
|
||||
@@ -123,6 +125,25 @@ export function GalleryManager() {
|
||||
handleRemoveFile(index){
|
||||
this.images[index].handleRemoveFile(null);
|
||||
this.images.splice(index, 1);
|
||||
},
|
||||
|
||||
dragStart(index){
|
||||
this.dragSrcI = index;
|
||||
},
|
||||
|
||||
dragOver(e, index){
|
||||
e.preventDefault();
|
||||
|
||||
if( this.dragSrcI === null || this.dragSrcI === index )
|
||||
return;
|
||||
|
||||
const moved = this.images.splice(this.dragSrcI, 1)[0];
|
||||
this.images.splice(index, 0, moved);
|
||||
this.dragSrcI = index;
|
||||
},
|
||||
|
||||
dragEnd(){
|
||||
this.dragSrcI = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user