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

Unified Diff: Source/devtools/front_end/ui/SplitView.js

Issue 713053002: DevTools: do not detach views that should be hidden upon detach. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « Source/devtools/front_end/splitView.css ('k') | Source/devtools/front_end/ui/View.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/ui/SplitView.js
diff --git a/Source/devtools/front_end/ui/SplitView.js b/Source/devtools/front_end/ui/SplitView.js
index 543991d3187724f7e6ae284c2c935cc067594ada..41cc1de27a127ddb903377a2f8590d124accbc6e 100644
--- a/Source/devtools/front_end/ui/SplitView.js
+++ b/Source/devtools/front_end/ui/SplitView.js
@@ -52,13 +52,8 @@ WebInspector.SplitView = function(isVertical, secondIsSidebar, settingName, defa
this._resizerElement = this.element.createChild("div", "split-view-resizer");
this._resizerElement.createChild("div", "split-view-resizer-border");
- if (secondIsSidebar) {
- this._mainView.show(this.element);
- this._sidebarView.show(this.element);
- } else {
- this._sidebarView.show(this.element);
- this._mainView.show(this.element);
- }
+ this._mainView.show(this.element);
+ this._sidebarView.show(this.element);
this._resizerWidget = new WebInspector.ResizerWidget();
this._resizerWidget.setEnabled(true);
@@ -202,16 +197,7 @@ WebInspector.SplitView.prototype = {
this._mainElement.classList.toggle("split-view-contents-second", !secondIsSidebar);
this._sidebarElement.classList.toggle("split-view-contents-first", !secondIsSidebar);
this._sidebarElement.classList.toggle("split-view-contents-second", secondIsSidebar);
-
- // Make sure second is last in the children array.
- if (secondIsSidebar) {
- if (this._sidebarElement.parentElement && this._sidebarElement.nextSibling)
- this.element.appendChild(this._sidebarElement);
- } else {
- if (this._mainElement.parentElement && this._mainElement.nextSibling)
- this.element.appendChild(this._mainElement);
- }
-
+ this.element.classList.toggle("split-view-first-is-sidebar", !secondIsSidebar);
this._secondIsSidebar = secondIsSidebar;
},
@@ -284,7 +270,11 @@ WebInspector.SplitView.prototype = {
*/
function callback()
{
- sideToShow.show(this.element);
+ // Make sure main is first in the children list.
+ if (sideToShow === this._mainView)
+ this._mainView.show(this.element, this._sidebarView.element);
+ else
+ this._sidebarView.show(this.element);
sideToHide.detach();
sideToShow.element.classList.add("maximized");
sideToHide.element.classList.remove("maximized");
@@ -336,7 +326,8 @@ WebInspector.SplitView.prototype = {
this._sidebarElement.classList.remove("maximized");
this._resizerElement.classList.remove("hidden");
- this._mainView.show(this.element);
+ // Make sure main is the first in the children list.
+ this._mainView.show(this.element, this._sidebarView.element);
this._sidebarView.show(this.element);
// Order views in DOM properly.
this.setSecondIsSidebar(this._secondIsSidebar);
« no previous file with comments | « Source/devtools/front_end/splitView.css ('k') | Source/devtools/front_end/ui/View.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698