From 04af07bd58129360d7f6eb250d42acdc5b4324bf Mon Sep 17 00:00:00 2001
From: Jonathan Wilkes <jon.w.wilkes@gmail.com>
Date: Sat, 19 Nov 2016 19:17:14 -0500
Subject: [PATCH] fix #164: Dragging a Pd patch into Purr-Data window shows the
 text of the patch in the window

---
 pd/nw/index.js     | 8 ++++++++
 pd/nw/pd_canvas.js | 8 ++++++++
 2 files changed, 16 insertions(+)

diff --git a/pd/nw/index.js b/pd/nw/index.js
index a7502fc06..ee164b871 100644
--- a/pd/nw/index.js
+++ b/pd/nw/index.js
@@ -323,6 +323,14 @@ function add_events() {
     document.getElementById("fileDialog").setAttribute("nwworkingdir", pwd);
     document.getElementById("fileDialog").setAttribute("accept",
         Object.keys(pdgui.pd_filetypes).toString());
+
+    // disable drag and drop for the time being
+    window.addEventListener("dragover", function (evt) {
+        evt.preventDefault();
+    }, false);
+    window.addEventListener("drop", function (evt) {
+        evt.preventDefault();
+    }, false);
 }
 
 function nw_close_window(window) {
diff --git a/pd/nw/pd_canvas.js b/pd/nw/pd_canvas.js
index f43d7f366..a20d821fd 100644
--- a/pd/nw/pd_canvas.js
+++ b/pd/nw/pd_canvas.js
@@ -554,6 +554,14 @@ var canvas_events = (function() {
         canvas_find_focus, false
     );
 
+    // disable drag and drop for the time being
+    window.addEventListener("dragover", function (evt) {
+        evt.preventDefault();
+    }, false);
+    window.addEventListener("drop", function (evt) {
+        evt.preventDefault();
+    }, false);
+
     // Add placeholder text... this all needs to be collected into an 
     // add_events function similiar to the one in index.js
     document.querySelector("#canvas_find_text").placeholder =
-- 
GitLab