comparison interfaces/ordinal.js @ 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 68e5a789702f 05fa3ce95015
comparison
equal deleted inserted replaced
2952:096b7a56ba27 2953:5e1e9e606373
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', String(audioObject.id));
255 sessionStorage.setItem("drag-object", audioObject.id); 255 sessionStorage.setItem("drag-object", String(audioObject.id));
256 } 256 }
257 257
258 function dragEnter(e) { 258 function dragEnter(e) {
259 // this / e.target is the current hover target. 259 // this / e.target is the current hover target.
260 root.classList.add('over'); 260 root.classList.add('over');
268 if (e.preventDefault) { 268 if (e.preventDefault) {
269 e.preventDefault(); // Necessary. Allows us to drop. 269 e.preventDefault(); // Necessary. Allows us to drop.
270 } 270 }
271 271
272 e.dataTransfer.dropEffect = 'move'; // See the section on the DataTransfer object. 272 e.dataTransfer.dropEffect = 'move'; // See the section on the DataTransfer object.
273 273 var srcid = e.dataTransfer.getData('text/plain');
274 var srcid = Number(sessionStorage.getItem("drag-object")); 274 if (srcid == "") {
275 srcid = sessionStorage.getItem("drag-object");
276 }
277 console.log(srcid);
278 var srcid = Number(srcid);
275 var elements = container.childNodes; 279 var elements = container.childNodes;
276 var srcObject = audioEngineContext.audioObjects.find(function (ao) { 280 var srcObject = audioEngineContext.audioObjects.find(function (ao) {
277 return ao.id === srcid; 281 return ao.id === srcid;
278 }); 282 });
279 var src = srcObject.interfaceDOM.root; 283 var src = srcObject.interfaceDOM.root;