comparison interfaces/ordinal.js @ 2952:096b7a56ba27

Potential fix for #141
author Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk>
date Tue, 31 Oct 2017 10:36:02 +0000
parents ed2c8a04b7c4
children 5e1e9e606373
comparison
equal deleted inserted replaced
2951:7d1a34b5a4d2 2952:096b7a56ba27
249 249
250 function dragStart(e) { 250 function dragStart(e) {
251 e.currentTarget.classList.add("dragging"); 251 e.currentTarget.classList.add("dragging");
252 252
253 e.dataTransfer.effectAllowed = 'move'; 253 e.dataTransfer.effectAllowed = 'move';
254 e.dataTransfer.setData('text/plain', audioObject.id); 254 //e.dataTransfer.setData('text/plain', audioObject.id);
255 sessionStorage.setItem("drag-object", audioObject.id);
255 } 256 }
256 257
257 function dragEnter(e) { 258 function dragEnter(e) {
258 // this / e.target is the current hover target. 259 // this / e.target is the current hover target.
259 root.classList.add('over'); 260 root.classList.add('over');
268 e.preventDefault(); // Necessary. Allows us to drop. 269 e.preventDefault(); // Necessary. Allows us to drop.
269 } 270 }
270 271
271 e.dataTransfer.dropEffect = 'move'; // See the section on the DataTransfer object. 272 e.dataTransfer.dropEffect = 'move'; // See the section on the DataTransfer object.
272 273
273 var srcid = Number(e.dataTransfer.getData("text/plain")); 274 var srcid = Number(sessionStorage.getItem("drag-object"));
274 var elements = container.childNodes; 275 var elements = container.childNodes;
275 var srcObject = audioEngineContext.audioObjects.find(function (ao) { 276 var srcObject = audioEngineContext.audioObjects.find(function (ao) {
276 return ao.id === srcid; 277 return ao.id === srcid;
277 }); 278 });
278 var src = srcObject.interfaceDOM.root; 279 var src = srcObject.interfaceDOM.root;
309 310
310 audioEngineContext.audioObjects.forEach(function (ao) { 311 audioEngineContext.audioObjects.forEach(function (ao) {
311 ao.interfaceDOM.processMovement(); 312 ao.interfaceDOM.processMovement();
312 }); 313 });
313 314
315 sessionStorage.removeItem("drag-object");
316
314 return false; 317 return false;
315 } 318 }
316 319
317 function dragEnd(e) { 320 function dragEnd(e) {
318 // this/e.target is the source node. 321 // this/e.target is the source node.