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 {
|
||||
create: createPopover,
|
||||
tooltip: function(target,content, action) {
|
||||
var label = function() {
|
||||
var label = content;
|
||||
if (action) {
|
||||
label = function() {
|
||||
var label = content;
|
||||
var shortcut = RED.keyboard.getShortcut(action);
|
||||
if (shortcut && shortcut.key) {
|
||||
label = $('<span>'+content+' <span class="red-ui-popover-key">'+RED.keyboard.formatKey(shortcut.key, true)+'</span></span>');
|
||||
}
|
||||
}
|
||||
return label;
|
||||
}
|
||||
}
|
||||
return RED.popover.create({
|
||||
var popover = RED.popover.create({
|
||||
tooltip: true,
|
||||
target:target,
|
||||
trigger: "hover",
|
||||
@ -456,6 +455,14 @@ RED.popover = (function() {
|
||||
content: label,
|
||||
delay: { show: 750, hide: 50 }
|
||||
});
|
||||
popover.setContent = function(newContent) {
|
||||
content = newContent;
|
||||
}
|
||||
popover.setAction = function(newAction) {
|
||||
action = newAction;
|
||||
}
|
||||
return popover;
|
||||
|
||||
},
|
||||
menu: function(options) {
|
||||
var list = $('<ul class="red-ui-menu"></ul>');
|
||||
|
Loading…
Reference in New Issue
Block a user