From 8782bc58965cce15ebbe8e21b11694b4ab9fb091 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Fri, 3 Jul 2015 11:17:27 +0100 Subject: [PATCH] Ensure sidebar panes are hidden, not removed on change --- editor/js/ui/sidebar.js | 4 ++-- editor/js/ui/tab-info.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/editor/js/ui/sidebar.js b/editor/js/ui/sidebar.js index b50b54c67..8b855f2d2 100644 --- a/editor/js/ui/sidebar.js +++ b/editor/js/ui/sidebar.js @@ -26,7 +26,7 @@ RED.sidebar = (function() { $(tab.content).show(); }, onremove: function(tab) { - $(tab.content).remove(); + $(tab.content).hide(); if (tab.onremove) { tab.onremove.call(tab); } @@ -76,9 +76,9 @@ RED.sidebar = (function() { function removeTab(id) { sidebar_tabs.removeTab(id); + $(knownTabs[id].content).remove(); delete knownTabs[id]; RED.menu.removeItem("menu-item-sidebar-menu-"+id); - //TODO: remove menu item } var sidebarSeparator = {}; diff --git a/editor/js/ui/tab-info.js b/editor/js/ui/tab-info.js index 933227d84..af120f58d 100644 --- a/editor/js/ui/tab-info.js +++ b/editor/js/ui/tab-info.js @@ -145,7 +145,7 @@ RED.sidebar.info = (function() { //table += '
'+(typeof info === "function" ? info.call(node) : info)+'
'; } - $("#tab-info").html(table); + $(content).html(table); $(".node-info-property-header").click(function(e) { var icon = $(this).find("i");