From 24913a5ef90d1766bf909fd99fb6fd1c552dbdae Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Wed, 27 Sep 2017 14:50:46 -0400 Subject: [PATCH] remove drag functions --- default_app/index.html | 30 +++++++++++------------------- default_app/main.js | 2 +- default_app/renderer.js | 31 +------------------------------ 3 files changed, 13 insertions(+), 50 deletions(-) diff --git a/default_app/index.html b/default_app/index.html index 41b5396360db..335be496d1df 100644 --- a/default_app/index.html +++ b/default_app/index.html @@ -1,4 +1,5 @@ + Electron +

- To run your app with Electron, execute the following command in your - Console (or Terminal): + To run your app with Electron, execute the following command in your Console (or Terminal):


 
     

- The path-to-your-app should be the path to your own Electron - app. + The path-to-your-app should be the path to your own Electron app.

-

You can read the quick start - guide in Electron's docs - to learn how to write one. +

You can read the quick start guide in Electron's docs to learn how to write one.

- -

- Or you can just drag your app here to run it: -

- -
- Drag your app here to run it -
-
- + + \ No newline at end of file diff --git a/default_app/main.js b/default_app/main.js index 89a6d2b097cb..6cf8d414212c 100644 --- a/default_app/main.js +++ b/default_app/main.js @@ -326,7 +326,7 @@ if (option.file && !option.webdriver) { process.exit(0) } else if (option.default) { const indexPath = path.join(__dirname, '/index.html') - loadApplicationByUrl(`file://${indexPath}`); + loadApplicationByUrl(`file://${indexPath}`) } else if (option.interactive) { startRepl() } else { diff --git a/default_app/renderer.js b/default_app/renderer.js index 6196195eab93..505d4909a43e 100644 --- a/default_app/renderer.js +++ b/default_app/renderer.js @@ -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`