Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(802)

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui/TabbedPane.js

Issue 2170063002: Revert of DevTools: keep widgets in widget hierarchy upon hide, split attach/detach cycle from show… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/ui/TabbedPane.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/TabbedPane.js b/third_party/WebKit/Source/devtools/front_end/ui/TabbedPane.js
index 5ef09e2837750b89f3e2d0b12c8f5f2b83871bb4..5ab070652d9c3c41e95359341277d54bc386a908 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/TabbedPane.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/TabbedPane.js
@@ -208,7 +208,6 @@ WebInspector.TabbedPane.prototype = {
else
this._tabs.push(tab);
this._tabsHistory.push(tab);
- view.attach(this.element);
if (this._tabsHistory[0] === tab && this.isShowing())
this.selectTab(tab.id, userGesture);
this._updateTabElements();
@@ -259,7 +258,6 @@ WebInspector.TabbedPane.prototype = {
this._tabs.splice(this._tabs.indexOf(tab), 1);
if (tab._shown)
this._hideTabElement(tab);
- tab.view.detach();
var eventData = { tabId: id, view: tab.view, isUserGesture: userGesture };
this.dispatchEventToListeners(WebInspector.TabbedPane.EventTypes.TabClosed, eventData);
@@ -425,17 +423,13 @@ WebInspector.TabbedPane.prototype = {
changeTabView: function(id, view)
{
var tab = this._tabsById[id];
- if (tab.view === view)
- return;
-
- var isSelected = this._currentTab && this._currentTab.id === id;
- if (isSelected)
- this._hideTab(tab);
- tab.view.detach();
- tab.view = view;
- tab.view.attach(this.element);
- if (isSelected)
+ if (this._currentTab && this._currentTab.id === tab.id) {
+ if (tab.view !== view)
+ this._hideTab(tab);
+ tab.view = view;
this._showTab(tab);
+ } else
+ tab.view = view;
},
onResize: function()
@@ -765,7 +759,7 @@ WebInspector.TabbedPane.prototype = {
_showTab: function(tab)
{
tab.tabElement.classList.add("selected");
- tab.view.showWidget();
+ tab.view.show(this.element);
this._updateTabSlider();
},
@@ -791,7 +785,7 @@ WebInspector.TabbedPane.prototype = {
_hideTab: function(tab)
{
tab.tabElement.classList.remove("selected");
- tab.view.hideWidget();
+ tab.view.detach();
},
/**

Powered by Google App Engine
This is Rietveld 408576698