Mercurial > hg > webaudioevaluationtool
changeset 3056:c5f5e2196a82
Merge branch 'master' into vnext
author | Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk> |
---|---|
date | Tue, 31 Oct 2017 10:54:22 +0000 |
parents | aa1ceca04519 (current diff) 5e1e9e606373 (diff) |
children | 05fa3ce95015 824c8539fd02 |
files | |
diffstat | 1 files changed, 10 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/interfaces/ordinal.js Tue Oct 31 09:58:15 2017 +0000 +++ b/interfaces/ordinal.js Tue Oct 31 10:54:22 2017 +0000 @@ -251,7 +251,8 @@ e.currentTarget.classList.add("dragging"); e.dataTransfer.effectAllowed = 'move'; - e.dataTransfer.setData('text/plain', audioObject.id); + e.dataTransfer.setData('text/plain', String(audioObject.id)); + sessionStorage.setItem("drag-object", String(audioObject.id)); } function dragEnter(e) { @@ -269,8 +270,12 @@ } e.dataTransfer.dropEffect = 'move'; // See the section on the DataTransfer object. - - var srcid = Number(e.dataTransfer.getData("text/plain")); + 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; @@ -311,6 +316,8 @@ ao.interfaceDOM.processMovement(); }); + sessionStorage.removeItem("drag-object"); + return false; }