remove drag functions

This commit is contained in:
Shelley Vohr 2017-09-27 14:50:46 -04:00
parent 2289d085fa
commit 24913a5ef9
No known key found for this signature in database
GPG key ID: F13993A75599653C
3 changed files with 13 additions and 50 deletions

View file

@ -1,9 +1,7 @@
const {remote, shell} = require('electron')
const {execFile} = require('child_process')
const {execPath} = remote.process
document.onclick = function (e) {
document.onclick = (e) => {
e.preventDefault()
if (e.target.tagName === 'A') {
shell.openExternal(e.target.href)
@ -11,33 +9,6 @@ document.onclick = function (e) {
return false
}
document.ondragover = document.ondrop = function (e) {
e.preventDefault()
return false
}
const holder = document.getElementById('holder')
holder.ondragover = function () {
this.className = 'hover'
return false
}
holder.ondragleave = holder.ondragend = function () {
this.className = ''
return false
}
holder.ondrop = function (e) {
this.className = ''
e.preventDefault()
const file = e.dataTransfer.files[0]
execFile(execPath, [file.path], {
detached: true, stdio: 'ignore'
}).unref()
return false
}
const version = process.versions.electron
document.querySelector('.header-version').innerText = version
document.querySelector('.command-example').innerText = `${execPath} path-to-your-app`