1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Fix node drag and drop animation

This commit is contained in:
Kazuhito Yokoi 2019-04-16 09:47:08 +09:00
parent ed2a45e975
commit 162bd6a8c3

View File

@ -254,7 +254,7 @@ RED.palette = (function() {
$(d).draggable({
helper: 'clone',
appendTo: 'body',
revert: true,
revert: 'invalid',
revertDuration: 50,
containment:'#main-container',
start: function() {
@ -264,11 +264,7 @@ RED.palette = (function() {
},
stop: function() { d3.select('.link_splice').classed('link_splice',false); if (spliceTimer) { clearTimeout(spliceTimer); spliceTimer = null;}},
drag: function(e,ui) {
// TODO: this is the margin-left of palette node. Hard coding
// it here makes me sad
//console.log(ui.helper.position());
ui.position.left += 17.5;
ui.originalPosition.left = $('#' + e.target.id).offset().left;
if (def.inputs > 0 && def.outputs > 0) {
mouseX = ui.position.left-paletteWidth+(ui.helper.width()/2) - chartOffset.left + chart.scrollLeft();