Skip to content

Commit

Permalink
ensure old config work with new fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Conway-Jones committed May 14, 2020
1 parent 1d71fb3 commit a849872
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions packages/node_modules/@node-red/nodes/core/common/21-debug.html
Expand Up @@ -318,6 +318,12 @@
delete RED._debug;
},
oneditprepare: function() {
$("#node-input-typed-status").typedInput({
default: "msg",
types:['msg',"jsonata"],
typeField: $("#node-input-statusType")
});
var that = this;
var none = {
value: "none",
label: RED._("node-red:debug.none"),
Expand All @@ -327,6 +333,14 @@
this.tosidebar = true;
$("#node-input-tosidebar").prop('checked', true);
}
if (this.statusVal === undefined) {
this.statusVal = (this.complete === "false") ? "payload" : ((this.complete === "true") ? "payload" : this.complete+"");
$("#node-input-typed-status").typedInput('value',this.statusVal || "");
}
if (this.statusType === undefined) {
this.statusType = this.targetType;
$("#node-input-typed-status").typedInput('type',this.statusType || "msg");
}
if (typeof this.console === "string") {
this.console = (this.console == 'true');
$("#node-input-console").prop('checked', this.console);
Expand Down Expand Up @@ -363,12 +377,7 @@
}
});

$("#node-input-typed-status").typedInput({
default: "msg",
types:['msg',"jsonata"],
typeField: $("#node-input-statusType")
});
var that = this;

$("#node-input-tostatus").on('change',function() {
if ($(this).is(":checked")) {
if (!that.hasOwnProperty("statusVal") || that.statusVal === "") {
Expand Down

0 comments on commit a849872

Please sign in to comment.