changeset 2953:5e1e9e606373

Further fixes for #141.
author Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk>
date Tue, 31 Oct 2017 10:43:19 +0000
parents 096b7a56ba27
children 7b2229be3183 c5f5e2196a82
files interfaces/ordinal.js
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/interfaces/ordinal.js	Tue Oct 31 10:36:02 2017 +0000
+++ b/interfaces/ordinal.js	Tue Oct 31 10:43:19 2017 +0000
@@ -251,8 +251,8 @@
         e.currentTarget.classList.add("dragging");
 
         e.dataTransfer.effectAllowed = 'move';
-        //e.dataTransfer.setData('text/plain', audioObject.id);
-        sessionStorage.setItem("drag-object", audioObject.id);
+        e.dataTransfer.setData('text/plain', String(audioObject.id));
+        sessionStorage.setItem("drag-object", String(audioObject.id));
     }
 
     function dragEnter(e) {
@@ -270,8 +270,12 @@
         }
 
         e.dataTransfer.dropEffect = 'move'; // See the section on the DataTransfer object.
-
-        var srcid = Number(sessionStorage.getItem("drag-object"));
+        var srcid = e.dataTransfer.getData('text/plain');
+        if (srcid == "") {
+            srcid = sessionStorage.getItem("drag-object");
+        }
+        console.log(srcid);
+        var srcid = Number(srcid);
         var elements = container.childNodes;
         var srcObject = audioEngineContext.audioObjects.find(function (ao) {
             return ao.id === srcid;