mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Editor: quick-add when connect to empty.
This commit is contained in:
		| @@ -124,6 +124,7 @@ | ||||
|             "projects-open": "Öffnen", | ||||
|             "projects-settings": "Einstellungen", | ||||
|             "showNodeLabelDefault": "Zeige Namen von neu hinzugefügten Nodes", | ||||
|             "nodeQuickAddLabel": "Zeige Schnellauswahl beim Verbinden ins Leere", | ||||
|             "codeEditor": "Code-Editor", | ||||
|             "groups": "Gruppen", | ||||
|             "groupSelection": "Auswahl gruppieren", | ||||
|   | ||||
| @@ -86,6 +86,7 @@ | ||||
|                 "rtl": "Right-to-left", | ||||
|                 "auto": "Contextual", | ||||
|                 "language": "Language", | ||||
| 								"nodeQuickAdd": "Quick-add node when joining to empty space", | ||||
|                 "browserDefault": "Browser default" | ||||
|             }, | ||||
|             "sidebar": { | ||||
|   | ||||
| @@ -140,7 +140,8 @@ RED.userSettings = (function() { | ||||
|             title: "menu.label.nodes", | ||||
|             options: [ | ||||
|                 {setting:"view-node-status",oldSetting:"menu-menu-item-status",label:"menu.label.displayStatus",default: true, toggle:true,onchange:"core:toggle-status"}, | ||||
|                 {setting:"view-node-show-label",label:"menu.label.showNodeLabelDefault",default: true, toggle:true} | ||||
|                 {setting:"view-node-show-label",label:"menu.label.showNodeLabelDefault",default: true, toggle:true}, | ||||
|                 {setting:"node-quick-add",label:"menu.label.view.nodeQuickAdd",default: true, toggle:true} | ||||
|             ] | ||||
|         }, | ||||
|         { | ||||
|   | ||||
| @@ -1801,22 +1801,34 @@ RED.view = (function() { | ||||
|             return; | ||||
|         } | ||||
|         if (mousedown_node && mouse_mode == RED.state.JOINING) { | ||||
|             var removedLinks = []; | ||||
|             for (i=0;i<drag_lines.length;i++) { | ||||
|                 if (drag_lines[i].link) { | ||||
|                     removedLinks.push(drag_lines[i].link) | ||||
|                 } | ||||
|             } | ||||
|             if (removedLinks.length > 0) { | ||||
|                 historyEvent = { | ||||
|                     t:"delete", | ||||
|                     links: removedLinks, | ||||
|                     dirty:RED.nodes.dirty() | ||||
|                 }; | ||||
|                 RED.history.push(historyEvent); | ||||
|                 RED.nodes.dirty(true); | ||||
|             } | ||||
|             hideDragLines(); | ||||
| 						if (RED.settings.get("editor.view.node-quick-add")) { | ||||
| 								// Trigger quick add dialog | ||||
| 								d3.event.stopPropagation(); | ||||
| 								clearSelection(); | ||||
| 								const point = d3.mouse(this); | ||||
| 								var clickedGroup = getGroupAt(point[0], point[1]); | ||||
| 								if (drag_lines.length > 0) { | ||||
| 										clickedGroup = clickedGroup || RED.nodes.group(drag_lines[0].node.g) | ||||
| 								} | ||||
| 								showQuickAddDialog({ position: point, group: clickedGroup }); | ||||
| 						} else { | ||||
| 								var removedLinks = []; | ||||
| 								for (i=0;i<drag_lines.length;i++) { | ||||
| 										if (drag_lines[i].link) { | ||||
| 												removedLinks.push(drag_lines[i].link) | ||||
| 										} | ||||
| 								} | ||||
| 								if (removedLinks.length > 0) { | ||||
| 										historyEvent = { | ||||
| 												t:"delete", | ||||
| 												links: removedLinks, | ||||
| 												dirty:RED.nodes.dirty() | ||||
| 										}; | ||||
| 										RED.history.push(historyEvent); | ||||
| 										RED.nodes.dirty(true); | ||||
| 								} | ||||
| 								hideDragLines(); | ||||
| 						} | ||||
|         } | ||||
|         if (lasso) { | ||||
|             var x = parseInt(lasso.attr("x")); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user