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

Add sidebar tab icons to drop-down menu

This commit is contained in:
Nick O'Leary 2018-07-11 14:15:31 +01:00
parent 7dd98e99f9
commit 28402b0894
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
3 changed files with 13 additions and 3 deletions

View File

@ -17,6 +17,9 @@
RED.tabs = (function() {
var defaultTabIcon = "fa fa-lemon-o";
function createTabs(options) {
var tabs = {};
var pinnedTabsCount = 0;
@ -71,6 +74,7 @@ RED.tabs = (function() {
var id = $(el).data('tabId');
var opt = {
id:"red-ui-tabs-menu-option-"+id,
icon: tabs[id].iconClass || defaultTabIcon,
label: tabs[id].name,
onselect: function() {
activateTab(id);
@ -339,7 +343,7 @@ RED.tabs = (function() {
if (tab.iconClass) {
$('<i>',{class:tab.iconClass}).appendTo(pinnedLink);
} else {
$('<i>',{class:"fa fa-lemon-o"}).appendTo(pinnedLink);
$('<i>',{class:defaultTabIcon}).appendTo(pinnedLink);
}
pinnedLink.click(function(evt) {
evt.preventDefault();
@ -363,7 +367,6 @@ RED.tabs = (function() {
removeTab(tab.id);
});
}
updateTabWidths();
if (options.onadd) {
options.onadd(tab);
}
@ -448,6 +451,9 @@ RED.tabs = (function() {
}
})
}
setTimeout(function() {
updateTabWidths();
},10);
collapsibleMenu = null;
},
removeTab: removeTab,

View File

@ -19,3 +19,7 @@
div.btn-group, a.btn {
@include disable-selection;
}
.dropdown-menu>li>a {
color: #444;
}

View File

@ -156,7 +156,7 @@
toolbar: uiComponents.footer,
enableOnEdit: true,
pinned: true,
iconClass: "fa fa-list-alt"
iconClass: "fa fa-bug"
});
RED.actions.add("core:show-debug-tab",function() { RED.sidebar.show('debug'); });