From 28402b0894af8a48f8f51755fc41a5d868d331e0 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Wed, 11 Jul 2018 14:15:31 +0100 Subject: [PATCH] Add sidebar tab icons to drop-down menu --- editor/js/ui/common/tabs.js | 10 ++++++++-- editor/sass/bootstrap.scss | 4 ++++ nodes/core/core/58-debug.html | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/editor/js/ui/common/tabs.js b/editor/js/ui/common/tabs.js index 700618495..d664235be 100644 --- a/editor/js/ui/common/tabs.js +++ b/editor/js/ui/common/tabs.js @@ -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) { $('',{class:tab.iconClass}).appendTo(pinnedLink); } else { - $('',{class:"fa fa-lemon-o"}).appendTo(pinnedLink); + $('',{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, diff --git a/editor/sass/bootstrap.scss b/editor/sass/bootstrap.scss index 56e7497dd..1aff6b8bf 100644 --- a/editor/sass/bootstrap.scss +++ b/editor/sass/bootstrap.scss @@ -19,3 +19,7 @@ div.btn-group, a.btn { @include disable-selection; } + +.dropdown-menu>li>a { + color: #444; +} diff --git a/nodes/core/core/58-debug.html b/nodes/core/core/58-debug.html index dc011ebda..d2ccdf15a 100644 --- a/nodes/core/core/58-debug.html +++ b/nodes/core/core/58-debug.html @@ -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'); });