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:
parent
7dd98e99f9
commit
28402b0894
@ -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,
|
||||
|
4
editor/sass/bootstrap.scss
vendored
4
editor/sass/bootstrap.scss
vendored
@ -19,3 +19,7 @@
|
||||
div.btn-group, a.btn {
|
||||
@include disable-selection;
|
||||
}
|
||||
|
||||
.dropdown-menu>li>a {
|
||||
color: #444;
|
||||
}
|
||||
|
@ -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'); });
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user