Commit bbd7d71c authored by jy1263's avatar jy1263

Drag and drop install implemented

Shows path in console when installed.
parent 69fcd2b8
......@@ -163,4 +163,25 @@ function BuildSongDOM(songItem) {
});
return songContainer;
}
\ No newline at end of file
}
document.ondragover = document.ondrop = (dragndrop) => {
dragndrop.preventDefault()
}
document.body.ondrop = (ev) => {
console.log("File dragged: " + ev.dataTransfer.files[0].path)
let filePath = (ev.dataTransfer.files[0].path)
let fileName = path.basename(filePath)
ev.preventDefault()
srxdControl.extractBackup(filePath, fileName).then(function(extractResults) {
if(extractResults) {
installBackup(extractResults);
setTimeout(function() {
RefreshLibrary();
}, 200);
} else {
console.error("Backup could not be loaded!");
}
});
}
\ No newline at end of file
document.ondragover = document.ondrop = (ev) => {
ev.preventDefault()
}
document.body.ondrop = (ev) => {
console.log(ev.dataTransfer.files[0].path)
ev.preventDefault()
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment