mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Add support of propty validation msg 4 typeField
This commit is contained in:
parent
5b5b06cc06
commit
26a4235028
@ -237,7 +237,13 @@ RED.editor = (function() {
|
|||||||
if (defaults[property].hasOwnProperty("format") && defaults[property].format !== "" && input[0].nodeName === "DIV") {
|
if (defaults[property].hasOwnProperty("format") && defaults[property].format !== "" && input[0].nodeName === "DIV") {
|
||||||
value = input.text();
|
value = input.text();
|
||||||
}
|
}
|
||||||
var valid = validateNodeProperty(node, defaults, property,value);
|
const isTypeField =
|
||||||
|
input.attr("type") === "hidden" &&
|
||||||
|
input.css("display") === "none" &&
|
||||||
|
input.attr("class") !== "red-ui-typedInput" &&
|
||||||
|
input.closest("div").find("input").length >= 2;
|
||||||
|
input = isTypeField ? input.closest("div").find("input[class='red-ui-typedInput']") : input;
|
||||||
|
var valid = validateNodeProperty(node, defaults, property, value);
|
||||||
if (((typeof valid) === "string") || !valid) {
|
if (((typeof valid) === "string") || !valid) {
|
||||||
input.addClass("input-error");
|
input.addClass("input-error");
|
||||||
input.next(".red-ui-typedInput-container").addClass("input-error");
|
input.next(".red-ui-typedInput-container").addClass("input-error");
|
||||||
@ -245,9 +251,10 @@ RED.editor = (function() {
|
|||||||
var tooltip = input.data("tooltip");
|
var tooltip = input.data("tooltip");
|
||||||
if (tooltip) {
|
if (tooltip) {
|
||||||
tooltip.setContent(valid);
|
tooltip.setContent(valid);
|
||||||
}
|
} else {
|
||||||
else {
|
const typedInput = input.next(".red-ui-typedInput-container").find(".red-ui-typedInput-input-wrap");
|
||||||
tooltip = RED.popover.tooltip(input, valid);
|
const target = typedInput.length > 0 ? typedInput : input;
|
||||||
|
tooltip = RED.popover.tooltip(target, valid);
|
||||||
input.data("tooltip", tooltip);
|
input.data("tooltip", tooltip);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user