Ensure sidebar panes are hidden, not removed on change

This commit is contained in:
Nick O'Leary 2015-07-03 11:17:27 +01:00
parent 6359b90352
commit 8782bc5896
2 changed files with 3 additions and 3 deletions

View File

@ -26,7 +26,7 @@ RED.sidebar = (function() {
$(tab.content).show(); $(tab.content).show();
}, },
onremove: function(tab) { onremove: function(tab) {
$(tab.content).remove(); $(tab.content).hide();
if (tab.onremove) { if (tab.onremove) {
tab.onremove.call(tab); tab.onremove.call(tab);
} }
@ -76,9 +76,9 @@ RED.sidebar = (function() {
function removeTab(id) { function removeTab(id) {
sidebar_tabs.removeTab(id); sidebar_tabs.removeTab(id);
$(knownTabs[id].content).remove();
delete knownTabs[id]; delete knownTabs[id];
RED.menu.removeItem("menu-item-sidebar-menu-"+id); RED.menu.removeItem("menu-item-sidebar-menu-"+id);
//TODO: remove menu item
} }
var sidebarSeparator = {}; var sidebarSeparator = {};

View File

@ -145,7 +145,7 @@ RED.sidebar.info = (function() {
//table += '<div class="node-help">'+(typeof info === "function" ? info.call(node) : info)+'</div>'; //table += '<div class="node-help">'+(typeof info === "function" ? info.call(node) : info)+'</div>';
} }
$("#tab-info").html(table); $(content).html(table);
$(".node-info-property-header").click(function(e) { $(".node-info-property-header").click(function(e) {
var icon = $(this).find("i"); var icon = $(this).find("i");