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() {
|
RED.tabs = (function() {
|
||||||
|
|
||||||
|
var defaultTabIcon = "fa fa-lemon-o";
|
||||||
|
|
||||||
function createTabs(options) {
|
function createTabs(options) {
|
||||||
var tabs = {};
|
var tabs = {};
|
||||||
var pinnedTabsCount = 0;
|
var pinnedTabsCount = 0;
|
||||||
@ -71,6 +74,7 @@ RED.tabs = (function() {
|
|||||||
var id = $(el).data('tabId');
|
var id = $(el).data('tabId');
|
||||||
var opt = {
|
var opt = {
|
||||||
id:"red-ui-tabs-menu-option-"+id,
|
id:"red-ui-tabs-menu-option-"+id,
|
||||||
|
icon: tabs[id].iconClass || defaultTabIcon,
|
||||||
label: tabs[id].name,
|
label: tabs[id].name,
|
||||||
onselect: function() {
|
onselect: function() {
|
||||||
activateTab(id);
|
activateTab(id);
|
||||||
@ -339,7 +343,7 @@ RED.tabs = (function() {
|
|||||||
if (tab.iconClass) {
|
if (tab.iconClass) {
|
||||||
$('<i>',{class:tab.iconClass}).appendTo(pinnedLink);
|
$('<i>',{class:tab.iconClass}).appendTo(pinnedLink);
|
||||||
} else {
|
} else {
|
||||||
$('<i>',{class:"fa fa-lemon-o"}).appendTo(pinnedLink);
|
$('<i>',{class:defaultTabIcon}).appendTo(pinnedLink);
|
||||||
}
|
}
|
||||||
pinnedLink.click(function(evt) {
|
pinnedLink.click(function(evt) {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
@ -363,7 +367,6 @@ RED.tabs = (function() {
|
|||||||
removeTab(tab.id);
|
removeTab(tab.id);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
updateTabWidths();
|
|
||||||
if (options.onadd) {
|
if (options.onadd) {
|
||||||
options.onadd(tab);
|
options.onadd(tab);
|
||||||
}
|
}
|
||||||
@ -448,6 +451,9 @@ RED.tabs = (function() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
setTimeout(function() {
|
||||||
|
updateTabWidths();
|
||||||
|
},10);
|
||||||
collapsibleMenu = null;
|
collapsibleMenu = null;
|
||||||
},
|
},
|
||||||
removeTab: removeTab,
|
removeTab: removeTab,
|
||||||
|
4
editor/sass/bootstrap.scss
vendored
4
editor/sass/bootstrap.scss
vendored
@ -19,3 +19,7 @@
|
|||||||
div.btn-group, a.btn {
|
div.btn-group, a.btn {
|
||||||
@include disable-selection;
|
@include disable-selection;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.dropdown-menu>li>a {
|
||||||
|
color: #444;
|
||||||
|
}
|
||||||
|
@ -156,7 +156,7 @@
|
|||||||
toolbar: uiComponents.footer,
|
toolbar: uiComponents.footer,
|
||||||
enableOnEdit: true,
|
enableOnEdit: true,
|
||||||
pinned: true,
|
pinned: true,
|
||||||
iconClass: "fa fa-list-alt"
|
iconClass: "fa fa-bug"
|
||||||
});
|
});
|
||||||
RED.actions.add("core:show-debug-tab",function() { RED.sidebar.show('debug'); });
|
RED.actions.add("core:show-debug-tab",function() { RED.sidebar.show('debug'); });
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user