mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Fix node drag and drop animation
This commit is contained in:
		@@ -254,7 +254,7 @@ RED.palette = (function() {
 | 
				
			|||||||
            $(d).draggable({
 | 
					            $(d).draggable({
 | 
				
			||||||
                helper: 'clone',
 | 
					                helper: 'clone',
 | 
				
			||||||
                appendTo: 'body',
 | 
					                appendTo: 'body',
 | 
				
			||||||
                revert: true,
 | 
					                revert: 'invalid',
 | 
				
			||||||
                revertDuration: 50,
 | 
					                revertDuration: 50,
 | 
				
			||||||
                containment:'#main-container',
 | 
					                containment:'#main-container',
 | 
				
			||||||
                start: function() {
 | 
					                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;}},
 | 
					                stop: function() { d3.select('.link_splice').classed('link_splice',false); if (spliceTimer) { clearTimeout(spliceTimer); spliceTimer = null;}},
 | 
				
			||||||
                drag: function(e,ui) {
 | 
					                drag: function(e,ui) {
 | 
				
			||||||
 | 
					                    ui.originalPosition.left = $('#' + e.target.id).offset().left;
 | 
				
			||||||
                    // 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;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    if (def.inputs > 0 && def.outputs > 0) {
 | 
					                    if (def.inputs > 0 && def.outputs > 0) {
 | 
				
			||||||
                        mouseX = ui.position.left-paletteWidth+(ui.helper.width()/2) - chartOffset.left + chart.scrollLeft();
 | 
					                        mouseX = ui.position.left-paletteWidth+(ui.helper.width()/2) - chartOffset.left + chart.scrollLeft();
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user