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

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

Issue 2170993002: Revert of DevTools: keep widgets in widget hierarchy upon hide, split attach/detach cycle from show/hide. (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 5685bfb6bc05610b71c5efb210be8a5092a48eee..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 @@
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 @@
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);
@@ -331,10 +329,8 @@
if (this._currentTab && this._currentTab.id === id)
return true;
- this.suspendInvalidations();
this._hideCurrentTab();
this._showTab(tab);
- this.resumeInvalidations();
this._currentTab = tab;
this._tabsHistory.splice(this._tabsHistory.indexOf(tab), 1);
@@ -427,19 +423,13 @@
changeTabView: function(id, view)
{
var tab = this._tabsById[id];
- if (tab.view === view)
- return;
-
- this.suspendInvalidations();
- 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);
- this.resumeInvalidations();
+ } else
+ tab.view = view;
},
onResize: function()
@@ -769,7 +759,7 @@
_showTab: function(tab)
{
tab.tabElement.classList.add("selected");
- tab.view.showWidget();
+ tab.view.show(this.element);
this._updateTabSlider();
},
@@ -795,7 +785,7 @@
_hideTab: function(tab)
{
tab.tabElement.classList.remove("selected");
- tab.view.hideWidget();
+ tab.view.detach();
},
/**

Powered by Google App Engine
This is Rietveld 408576698