From ee42cb21dd8d588c776a6fe38b20c65fa66b01ce Mon Sep 17 00:00:00 2001 From: j Date: Thu, 24 Jan 2019 13:56:35 +0530 Subject: [PATCH 1/2] add folder --- static/json/js.json | 1 + 1 file changed, 1 insertion(+) diff --git a/static/json/js.json b/static/json/js.json index 0478da7..5578ee0 100644 --- a/static/json/js.json +++ b/static/json/js.json @@ -4,6 +4,7 @@ "URL.js", "allItems.js", "annotation.js", + "annotationFolder.js", "annotationPanel.js", "appDialog.js", "appPanel.js", From 4810a7ee97f08ba55266305d6bef4c9a13a1518b Mon Sep 17 00:00:00 2001 From: j Date: Thu, 24 Jan 2019 13:56:59 +0530 Subject: [PATCH 2/2] only allow dropping of files --- static/js/oml.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/static/js/oml.js b/static/js/oml.js index 12c3370..07be0e2 100644 --- a/static/js/oml.js +++ b/static/js/oml.js @@ -118,10 +118,14 @@ }); Ox.$document.on({ dragenter: function(event) { - event.originalEvent.preventDefault(); - event.originalEvent.stopPropagation(); - if (!$('#importScreen').length && !$('#closedScreen').length) { - oml.ui.importScreen().appendTo(Ox.$body); + if (Ox.contains(event.originalEvent.dataTransfer.types, 'Files')) { + event.originalEvent.preventDefault(); + event.originalEvent.stopPropagation(); + if (!$('#importScreen').length && !$('#closedScreen').length) { + oml.ui.importScreen().appendTo(Ox.$body); + } + } else { + console.log(event.originalEvent.dataTransfer); } }, dragover: function(event) {