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

Unified Diff: Source/devtools/front_end/MetricsSidebarPane.js

Issue 218703002: DevTools: [wip] move Elements panel off WebInspector.domModel and single tree outline. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Review comment addressed (and much more) Created 6 years, 9 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: Source/devtools/front_end/MetricsSidebarPane.js
diff --git a/Source/devtools/front_end/MetricsSidebarPane.js b/Source/devtools/front_end/MetricsSidebarPane.js
index f39f6c5d27932d26c85b66078a37dd3536ceb50d..9da24e8007a933643e4ddc7092bff03699cd04a4 100644
--- a/Source/devtools/front_end/MetricsSidebarPane.js
+++ b/Source/devtools/front_end/MetricsSidebarPane.js
@@ -140,12 +140,11 @@ WebInspector.MetricsSidebarPane.prototype = {
_highlightDOMNode: function(showHighlight, mode, event)
{
event.consume();
- var nodeId = showHighlight && this.node ? this.node.id : 0;
- if (nodeId) {
+ if (showHighlight && this.node) {
if (this._highlightMode === mode)
return;
this._highlightMode = mode;
- WebInspector.domModel.highlightDOMNode(nodeId, mode);
+ this.node.highlight(mode);
} else {
delete this._highlightMode;
WebInspector.domModel.hideDOMNodeHighlight();
@@ -153,7 +152,7 @@ WebInspector.MetricsSidebarPane.prototype = {
for (var i = 0; this._boxElements && i < this._boxElements.length; ++i) {
var element = this._boxElements[i];
- if (!nodeId || mode === "all" || element._name === mode)
+ if (!this.node || mode === "all" || element._name === mode)
element.style.backgroundColor = element._backgroundColor;
else
element.style.backgroundColor = "";
@@ -433,9 +432,8 @@ WebInspector.MetricsSidebarPane.prototype = {
if (!("originalPropertyData" in self))
self.originalPropertyData = self.previousPropertyDataCandidate;
- if (typeof self._highlightMode !== "undefined") {
- WebInspector.domModel.highlightDOMNode(self.node.id, self._highlightMode);
- }
+ if (typeof self._highlightMode !== "undefined")
+ self.node.highlight(self._highlightMode);
if (commitEditor) {
self.dispatchEventToListeners("metrics edited");
« no previous file with comments | « Source/devtools/front_end/EventListenersSidebarPane.js ('k') | Source/devtools/front_end/PropertiesSidebarPane.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698