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

Unified Diff: third_party/WebKit/Source/devtools/front_end/components/Spectrum.js

Issue 2377193004: [DevTools] Rework some focus code. (Closed)
Patch Set: fixes Created 4 years, 3 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: third_party/WebKit/Source/devtools/front_end/components/Spectrum.js
diff --git a/third_party/WebKit/Source/devtools/front_end/components/Spectrum.js b/third_party/WebKit/Source/devtools/front_end/components/Spectrum.js
index 0d33461d0cab4c58eceabc08ddc92bc44206e657..ce9e26d3eb452b32c7f82276e33fe6fc66456d30 100644
--- a/third_party/WebKit/Source/devtools/front_end/components/Spectrum.js
+++ b/third_party/WebKit/Source/devtools/front_end/components/Spectrum.js
@@ -228,8 +228,8 @@ WebInspector.Spectrum.prototype = {
_focus: function()
{
- if (this.isShowing() && WebInspector.currentFocusElement() !== this.contentElement)
- WebInspector.setCurrentFocusElement(this.contentElement);
+ if (this.isShowing())
+ this.contentElement.focus();
},
/**
@@ -328,7 +328,7 @@ WebInspector.Spectrum.prototype = {
this._shadesContainer.appendChild(shadeElement);
}
- WebInspector.setCurrentFocusElement(this._shadesContainer);
+ this._shadesContainer.focus();
this._shadesCloseHandler = closeLightnessShades.bind(this, colorElement);
this._shadesContainer.ownerDocument.addEventListener("mousedown", this._shadesCloseHandler, true);
},

Powered by Google App Engine
This is Rietveld 408576698