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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/ui/SidebarPane.js

Issue 2157363006: 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: lcean 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 28 matching lines...) Expand all
39 this.element.textContent = pane.title(); 39 this.element.textContent = pane.title();
40 this.element.tabIndex = 0; 40 this.element.tabIndex = 0;
41 this.element.addEventListener("click", this._toggleExpanded.bind(this), fals e); 41 this.element.addEventListener("click", this._toggleExpanded.bind(this), fals e);
42 this.element.addEventListener("keydown", this._onTitleKeyDown.bind(this), fa lse); 42 this.element.addEventListener("keydown", this._onTitleKeyDown.bind(this), fa lse);
43 } 43 }
44 44
45 WebInspector.SidebarPaneTitle.prototype = { 45 WebInspector.SidebarPaneTitle.prototype = {
46 _expand: function() 46 _expand: function()
47 { 47 {
48 this.element.classList.add("expanded"); 48 this.element.classList.add("expanded");
49 this._pane.show(this.element.parentElement, /** @type {?Element} */ (thi s.element.nextSibling)); 49 this._pane.show(/** @type {!Element} */(this.element.parentElement), /** @type {?Element} */ (this.element.nextSibling));
50 }, 50 },
51 51
52 _collapse: function() 52 _collapse: function()
53 { 53 {
54 this.element.classList.remove("expanded"); 54 this.element.classList.remove("expanded");
55 if (this._pane.element.parentNode === this.element.parentNode) 55 if (this._pane.element.parentNode === this.element.parentNode)
56 this._pane.detach(); 56 this._pane.detach();
57 }, 57 },
58 58
59 _toggleExpanded: function() 59 _toggleExpanded: function()
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 if (!this.hasTab(title)) 163 if (!this.hasTab(title))
164 this.appendTab(title, title, pane); 164 this.appendTab(title, title, pane);
165 } else { 165 } else {
166 if (this.hasTab(title)) 166 if (this.hasTab(title))
167 this.closeTab(title); 167 this.closeTab(title);
168 } 168 }
169 }, 169 },
170 170
171 __proto__: WebInspector.TabbedPane.prototype 171 __proto__: WebInspector.TabbedPane.prototype
172 } 172 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698