mirror of https://github.com/node-red/node-red.git
Add `splice` property to nodes:add event context
parent
3e9106635c
commit
c532b55513
|
|
@ -660,7 +660,9 @@ RED.view = (function() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var historyEvent = result.historyEvent;
|
var historyEvent = result.historyEvent;
|
||||||
var nn = RED.nodes.add(result.node, { source: 'palette' });
|
const linkToSplice = $(ui.helper).data("splice");
|
||||||
|
|
||||||
|
var nn = RED.nodes.add(result.node, { source: 'palette', splice: !!linkToSplice });
|
||||||
|
|
||||||
var showLabel = RED.utils.getMessageProperty(RED.settings.get('editor'),"view.view-node-show-label");
|
var showLabel = RED.utils.getMessageProperty(RED.settings.get('editor'),"view.view-node-show-label");
|
||||||
if (showLabel !== undefined && (nn._def.hasOwnProperty("showLabel")?nn._def.showLabel:true) && !nn._def.defaults.hasOwnProperty("l")) {
|
if (showLabel !== undefined && (nn._def.hasOwnProperty("showLabel")?nn._def.showLabel:true) && !nn._def.defaults.hasOwnProperty("l")) {
|
||||||
|
|
@ -719,7 +721,6 @@ RED.view = (function() {
|
||||||
nn.y -= gridOffset.y;
|
nn.y -= gridOffset.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
var linkToSplice = $(ui.helper).data("splice");
|
|
||||||
if (linkToSplice) {
|
if (linkToSplice) {
|
||||||
spliceLink(linkToSplice, nn, historyEvent)
|
spliceLink(linkToSplice, nn, historyEvent)
|
||||||
}
|
}
|
||||||
|
|
@ -1560,7 +1561,7 @@ RED.view = (function() {
|
||||||
if (nn.type === 'junction') {
|
if (nn.type === 'junction') {
|
||||||
nn = RED.nodes.addJunction(nn);
|
nn = RED.nodes.addJunction(nn);
|
||||||
} else {
|
} else {
|
||||||
nn = RED.nodes.add(nn, { source: 'typeSearch' });
|
nn = RED.nodes.add(nn, { source: 'typeSearch', splice: !!linkToSplice });
|
||||||
}
|
}
|
||||||
if (quickAddLink) {
|
if (quickAddLink) {
|
||||||
var drag_line = quickAddLink;
|
var drag_line = quickAddLink;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue