mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Allow toolip action/content to be updated
This commit is contained in:
parent
7cd92faf0d
commit
bed1be14ba
@ -436,18 +436,17 @@ RED.popover = (function() {
|
|||||||
return {
|
return {
|
||||||
create: createPopover,
|
create: createPopover,
|
||||||
tooltip: function(target,content, action) {
|
tooltip: function(target,content, action) {
|
||||||
var label = content;
|
var label = function() {
|
||||||
if (action) {
|
var label = content;
|
||||||
label = function() {
|
if (action) {
|
||||||
var label = content;
|
|
||||||
var shortcut = RED.keyboard.getShortcut(action);
|
var shortcut = RED.keyboard.getShortcut(action);
|
||||||
if (shortcut && shortcut.key) {
|
if (shortcut && shortcut.key) {
|
||||||
label = $('<span>'+content+' <span class="red-ui-popover-key">'+RED.keyboard.formatKey(shortcut.key, true)+'</span></span>');
|
label = $('<span>'+content+' <span class="red-ui-popover-key">'+RED.keyboard.formatKey(shortcut.key, true)+'</span></span>');
|
||||||
}
|
}
|
||||||
return label;
|
|
||||||
}
|
}
|
||||||
|
return label;
|
||||||
}
|
}
|
||||||
return RED.popover.create({
|
var popover = RED.popover.create({
|
||||||
tooltip: true,
|
tooltip: true,
|
||||||
target:target,
|
target:target,
|
||||||
trigger: "hover",
|
trigger: "hover",
|
||||||
@ -456,6 +455,14 @@ RED.popover = (function() {
|
|||||||
content: label,
|
content: label,
|
||||||
delay: { show: 750, hide: 50 }
|
delay: { show: 750, hide: 50 }
|
||||||
});
|
});
|
||||||
|
popover.setContent = function(newContent) {
|
||||||
|
content = newContent;
|
||||||
|
}
|
||||||
|
popover.setAction = function(newAction) {
|
||||||
|
action = newAction;
|
||||||
|
}
|
||||||
|
return popover;
|
||||||
|
|
||||||
},
|
},
|
||||||
menu: function(options) {
|
menu: function(options) {
|
||||||
var list = $('<ul class="red-ui-menu"></ul>');
|
var list = $('<ul class="red-ui-menu"></ul>');
|
||||||
|
Loading…
Reference in New Issue
Block a user