mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Fixed the problems when using a node without defaults
This commit is contained in:
parent
fdae75c99b
commit
f21260370f
@ -191,7 +191,7 @@ RED.history = (function() {
|
|||||||
} else if (ev.t == "edit") {
|
} else if (ev.t == "edit") {
|
||||||
for (i in ev.changes) {
|
for (i in ev.changes) {
|
||||||
if (ev.changes.hasOwnProperty(i)) {
|
if (ev.changes.hasOwnProperty(i)) {
|
||||||
if (ev.node._def.defaults[i] && ev.node._def.defaults[i].type) {
|
if (ev.node._def.defaults && ev.node._def.defaults[i] && ev.node._def.defaults[i].type) {
|
||||||
// This is a config node property
|
// This is a config node property
|
||||||
var currentConfigNode = RED.nodes.node(ev.node[i]);
|
var currentConfigNode = RED.nodes.node(ev.node[i]);
|
||||||
if (currentConfigNode) {
|
if (currentConfigNode) {
|
||||||
|
@ -742,7 +742,7 @@ RED.editor = (function() {
|
|||||||
buildLabelRow().appendTo(outputsDiv);
|
buildLabelRow().appendTo(outputsDiv);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!node._def.defaults.hasOwnProperty("icon") && node.type !== "subflow") {
|
if ((!node._def.defaults || !node._def.defaults.hasOwnProperty("icon")) && node.type !== "subflow") {
|
||||||
$('<div class="form-row"><div id="node-settings-icon"></div></div>').appendTo(dialogForm);
|
$('<div class="form-row"><div id="node-settings-icon"></div></div>').appendTo(dialogForm);
|
||||||
var iconDiv = $("#node-settings-icon");
|
var iconDiv = $("#node-settings-icon");
|
||||||
$('<label data-i18n="editor.settingIcon">').appendTo(iconDiv);
|
$('<label data-i18n="editor.settingIcon">').appendTo(iconDiv);
|
||||||
@ -1071,7 +1071,7 @@ RED.editor = (function() {
|
|||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!editing_node._def.defaults.hasOwnProperty("icon")) {
|
if (!editing_node._def.defaults || !editing_node._def.defaults.hasOwnProperty("icon")) {
|
||||||
var iconModule = $("#node-settings-icon-module-hidden").val();
|
var iconModule = $("#node-settings-icon-module-hidden").val();
|
||||||
var iconFile = $("#node-settings-icon-file-hidden").val();
|
var iconFile = $("#node-settings-icon-file-hidden").val();
|
||||||
var icon = (iconModule && iconFile) ? iconModule+"/"+iconFile : "";
|
var icon = (iconModule && iconFile) ? iconModule+"/"+iconFile : "";
|
||||||
|
Loading…
Reference in New Issue
Block a user