mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Add tooltip to flow add button
This commit is contained in:
parent
242398c724
commit
2816b3edae
@ -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",
|
||||
|
@ -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();
|
||||
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;
|
||||
|
@ -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,11 +338,11 @@ RED.workspaces = (function() {
|
||||
if (workspace_tabs.contains(ws.id)) {
|
||||
workspace_tabs.removeTab(ws.id);
|
||||
}
|
||||
}
|
||||
if (ws.id === activeWorkspace) {
|
||||
activeWorkspace = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function setWorkspaceOrder(order) {
|
||||
RED.nodes.setWorkspaceOrder(order.filter(function(id) {
|
||||
|
Loading…
Reference in New Issue
Block a user