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

Unified Diff: third_party/WebKit/Source/devtools/front_end/resources/ApplicationPanelSidebar.js

Issue 2897173003: [DevTools] Simplify selection restoration logic (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/resources/ApplicationPanelSidebar.js
diff --git a/third_party/WebKit/Source/devtools/front_end/resources/ApplicationPanelSidebar.js b/third_party/WebKit/Source/devtools/front_end/resources/ApplicationPanelSidebar.js
index d2e6d7af0541eb79cd8909bb23145fea78b8e1e7..6b2d25e6b90ae567d4a9d0fc06bc222cf231818b 100644
--- a/third_party/WebKit/Source/devtools/front_end/resources/ApplicationPanelSidebar.js
+++ b/third_party/WebKit/Source/devtools/front_end/resources/ApplicationPanelSidebar.js
@@ -40,8 +40,6 @@ Resources.ApplicationPanelSidebar = class extends UI.VBox {
this._panel = panel;
- this._shouldRestoreSelection = true;
-
this._sidebarTree = new UI.TreeOutlineInShadow();
this._sidebarTree.element.classList.add('resources-sidebar');
this._sidebarTree.registerRequiredCSS('resources/resourcesSidebar.css');
@@ -113,11 +111,9 @@ Resources.ApplicationPanelSidebar = class extends UI.VBox {
SDK.targetManager.observeTargets(this);
SDK.targetManager.addModelListener(
SDK.ResourceTreeModel, SDK.ResourceTreeModel.Events.FrameNavigated, this._frameNavigated, this);
- SDK.targetManager.addModelListener(
- SDK.ResourceTreeModel, SDK.ResourceTreeModel.Events.WillReloadPage, this._willReloadPage, this);
var selection = this._panel.lastSelectedItemPath();
- if (this._shouldRestoreSelection && !selection.length)
+ if (!selection.length)
this._manifestTreeElement.select();
}
@@ -233,16 +229,10 @@ Resources.ApplicationPanelSidebar = class extends UI.VBox {
this.applicationCacheListTreeElement.setExpandable(false);
}
- _willReloadPage() {
- this._shouldRestoreSelection = true;
- }
-
/**
* @param {!Common.Event} event
*/
_treeElementAdded(event) {
- if (!this._shouldRestoreSelection)
- return;
var selection = this._panel.lastSelectedItemPath();
if (!selection.length)
return;
@@ -255,8 +245,6 @@ Resources.ApplicationPanelSidebar = class extends UI.VBox {
if (index > 0)
element.expand();
element.select();
- if (index === 0)
- this._shouldRestoreSelection = false;
}
_reset() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698