-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or requestfront-endtodo
Description
when moving block outside of current drop-zone, it snaps to dropzone parent's X position
already spend too much time on getting it close enough, so only implementing this if time allows for it
tags: enhancement, front-end
SOIT-SMARS-project/static/blockInteract.js
Line 136 in 2dbf461
// TODO smoother x-position transform |
},
ondragleave: function (event) {
// remove the drop feedback style
let network = document.getElementById('network');
let draggedBlock = document.getElementById(event.relatedTarget.id);
if(event.target.parentElement === draggedBlock){
return
}
event.target.classList.remove('drop-target')
if(draggedBlock.parentElement !== network){
// prevent teleporting blocks as referenced in issues #14 and #20
// TODO smoother x-position transform
// when moving block outside of current drop-zone, it snaps to dropzone parent's X position
// already spend too much time on getting it close enough, so only implementing this if time allows for it
// tags: enhancement, front-end
draggedBlock.style.transform = event.target.parentElement.style.transform
positions[draggedBlock.id] = {...positions[event.target.parentElement.id]}
positions[draggedBlock.id].y += 50
}
network.appendChild(draggedBlock);
},
ondrop: function (event) {
// sets parent of currently dropped block to be the dropzone's accompanying block
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or requestfront-endtodo