1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Add tooltips to tabs and close/hide buttons

This commit is contained in:
Nick O'Leary 2021-12-02 09:23:13 +00:00
parent dcea382b38
commit a824b6910a
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -811,6 +811,7 @@ RED.tabs = (function() {
event.preventDefault(); event.preventDefault();
removeTab(tab.id); removeTab(tab.id);
}); });
RED.popover.tooltip(closeLink,RED._("workspace.hideFlow"));
} }
if (tab.hideable) { if (tab.hideable) {
li.addClass("red-ui-tabs-closeable") li.addClass("red-ui-tabs-closeable")
@ -821,6 +822,7 @@ RED.tabs = (function() {
event.preventDefault(); event.preventDefault();
hideTab(tab.id); hideTab(tab.id);
}); });
RED.popover.tooltip(closeLink,RED._("workspace.hideFlow"));
} }
var badges = $('<span class="red-ui-tabs-badges"></span>').appendTo(li); var badges = $('<span class="red-ui-tabs-badges"></span>').appendTo(li);
@ -829,7 +831,8 @@ RED.tabs = (function() {
$('<i class="red-ui-tabs-badge-selected fa fa-check-circle"></i>').appendTo(badges); $('<i class="red-ui-tabs-badge-selected fa fa-check-circle"></i>').appendTo(badges);
} }
link.attr("title",tab.label); // link.attr("title",tab.label);
RED.popover.tooltip(link,function() { return tab.label})
if (options.onadd) { if (options.onadd) {
options.onadd(tab); options.onadd(tab);
@ -948,7 +951,6 @@ RED.tabs = (function() {
renameTab: function(id,label) { renameTab: function(id,label) {
tabs[id].label = label; tabs[id].label = label;
var tab = ul.find("a[href='#"+id+"']"); var tab = ul.find("a[href='#"+id+"']");
tab.attr("title",label);
tab.find("span.red-ui-text-bidi-aware").text(label).attr('dir', RED.text.bidi.resolveBaseTextDir(label)); tab.find("span.red-ui-text-bidi-aware").text(label).attr('dir', RED.text.bidi.resolveBaseTextDir(label));
updateTabWidths(); updateTabWidths();
}, },