mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Cleanup + fix popover.getContent can be a function and apply #4450 changes
This commit is contained in:
parent
ca37d1ec9d
commit
6aae50294f
@ -53,8 +53,8 @@
|
||||
* Returns the popover object with the following properties/functions:
|
||||
* properties:
|
||||
* - element : DOM element - the popover dom element
|
||||
* - content : string|function - the popover content
|
||||
* functions:
|
||||
* - getContent() - get the popover content
|
||||
* - setContent(content) - change the popover content. This only works if the
|
||||
* popover is not currently displayed. It does not
|
||||
* change the content of a visible popover.
|
||||
@ -160,7 +160,7 @@ RED.popover = (function() {
|
||||
var size = options.size||"default";
|
||||
var popupOffset = options.offset || 0;
|
||||
if (!deltaSizes[size]) {
|
||||
throw new Error("Invalid RED.popover size value:" + size);
|
||||
throw new Error("Invalid RED.popover size value: " + size);
|
||||
}
|
||||
|
||||
var timer = null;
|
||||
@ -420,7 +420,6 @@ RED.popover = (function() {
|
||||
}
|
||||
var res = {
|
||||
get element() { return div },
|
||||
get content() { return content },
|
||||
setContent: function(_content) {
|
||||
content = _content;
|
||||
|
||||
@ -471,7 +470,7 @@ RED.popover = (function() {
|
||||
delay: { show: 750, hide: 50 }
|
||||
});
|
||||
popover.getContent = function () {
|
||||
return content;
|
||||
return label();
|
||||
}
|
||||
popover.setContent = function(newContent) {
|
||||
content = newContent;
|
||||
|
@ -1560,6 +1560,7 @@
|
||||
}
|
||||
}
|
||||
if ((typeof valid === "string") || !valid) {
|
||||
this.element.addClass("input-error");
|
||||
this.uiSelect.addClass("input-error");
|
||||
if (typeof valid === "string") {
|
||||
let tooltip = this.element.data("tooltip");
|
||||
@ -1571,6 +1572,7 @@
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.element.removeClass("input-error");
|
||||
this.uiSelect.removeClass("input-error");
|
||||
const tooltip = this.element.data("tooltip");
|
||||
if (tooltip) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user