Add tooltip to flow add button

This commit is contained in:
Nick O'Leary 2018-10-17 13:45:57 +01:00
parent 242398c724
commit 2816b3edae
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
3 changed files with 19 additions and 9 deletions

View File

@ -23,6 +23,7 @@
"confirmDelete": "Confirm delete",
"delete": "Are you sure you want to delete '__label__'?",
"dropFlowHere": "Drop the flow here",
"addFlow": "Add Flow",
"status": "Status",
"enabled": "Enabled",
"disabled":"Disabled",

View File

@ -34,14 +34,24 @@ RED.tabs = (function() {
if (options.vertical) {
wrapper.addClass("red-ui-tabs-vertical");
}
if (options.addButton && typeof options.addButton === 'function') {
if (options.addButton) {
wrapper.addClass("red-ui-tabs-add");
var addButton = $('<div class="red-ui-tab-button"><a href="#"><i class="fa fa-plus"></i></a></div>').appendTo(wrapper);
addButton.find('a').click(function(evt) {
evt.preventDefault();
options.addButton();
if (typeof options.addButton === 'function') {
options.addButton();
} else if (typeof options.addButton === 'string') {
RED.actions.invoke(options.addButton);
}
})
if (typeof options.addButton === 'string') {
var l = options.addButton;
if (options.addButtonCaption) {
l = options.addButtonCaption
}
RED.popover.tooltip(addButton,l,options.addButton);
}
}
var scrollLeft;
var scrollRight;

View File

@ -289,9 +289,8 @@ RED.workspaces = (function() {
},
minimumActiveTabWidth: 150,
scrollable: true,
addButton: function() {
addWorkspace();
}
addButton: "core:add-flow",
addButtonCaption: RED._("workspace.addFlow")
});
workspaceTabCount = 0;
}
@ -339,9 +338,9 @@ RED.workspaces = (function() {
if (workspace_tabs.contains(ws.id)) {
workspace_tabs.removeTab(ws.id);
}
}
if (ws.id === activeWorkspace) {
activeWorkspace = 0;
if (ws.id === activeWorkspace) {
activeWorkspace = 0;
}
}
}