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

Unified Diff: Source/devtools/front_end/sources/ObjectEventListenersSidebarPane.js

Issue 1213693006: [DevTools] Don't update Object Event Listeners sidebar when hidden (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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 | « LayoutTests/inspector/sources/debugger-step/debugger-step-out-document-write-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/sources/ObjectEventListenersSidebarPane.js
diff --git a/Source/devtools/front_end/sources/ObjectEventListenersSidebarPane.js b/Source/devtools/front_end/sources/ObjectEventListenersSidebarPane.js
index bdc30fc1ef485db7cdc82991ea7a48eb71b80851..30383c563e6187ff4e8a3727a5c442f01763efe9 100644
--- a/Source/devtools/front_end/sources/ObjectEventListenersSidebarPane.js
+++ b/Source/devtools/front_end/sources/ObjectEventListenersSidebarPane.js
@@ -11,11 +11,11 @@ WebInspector.ObjectEventListenersSidebarPane = function()
WebInspector.SidebarPane.call(this, "Event Listeners");
this.element.classList.add("event-listeners-sidebar-pane");
- var refreshButton = new WebInspector.ToolbarButton(WebInspector.UIString("Refresh"), "refresh-toolbar-item");
- refreshButton.addEventListener("click", this._refreshClick.bind(this));
- this.toolbar().appendToolbarItem(refreshButton);
+ this._refreshButton = new WebInspector.ToolbarButton(WebInspector.UIString("Refresh"), "refresh-toolbar-item");
+ this._refreshButton.addEventListener("click", this._refreshClick.bind(this));
+ this._refreshButton.setEnabled(false);
+ this.toolbar().appendToolbarItem(this._refreshButton);
- WebInspector.context.addFlavorChangeListener(WebInspector.ExecutionContext, this.update, this);
this._eventListenersView = new WebInspector.EventListenersView(this.element);
}
@@ -38,12 +38,21 @@ WebInspector.ObjectEventListenersSidebarPane.prototype = {
Promise.all([this._windowObjectInContext(executionContext)]).then(this._eventListenersView.addObjects.bind(this._eventListenersView));
},
- expand: function()
+ wasShown: function()
{
- WebInspector.SidebarPane.prototype.expand.call(this);
+ WebInspector.SidebarPane.prototype.wasShown.call(this);
+ WebInspector.context.addFlavorChangeListener(WebInspector.ExecutionContext, this.update, this);
+ this._refreshButton.setEnabled(true);
this.update();
},
+ willHide: function()
+ {
+ WebInspector.SidebarPane.prototype.willHide.call(this);
+ WebInspector.context.removeFlavorChangeListener(WebInspector.ExecutionContext, this.update, this);
+ this._refreshButton.setEnabled(false);
+ },
+
/**
* @param {!WebInspector.ExecutionContext} executionContext
* @return {!Promise<!WebInspector.RemoteObject>} object
« no previous file with comments | « LayoutTests/inspector/sources/debugger-step/debugger-step-out-document-write-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698