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

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui/ColorSwatch.js

Issue 2157533003: DevTools: Source color picker experiment. Make color swatches clickable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: StylesPopoverHelper --> SwatchPopoverHelper in separate patches 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/ui/ColorSwatch.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/ColorSwatch.js b/third_party/WebKit/Source/devtools/front_end/ui/ColorSwatch.js
index 7fe3f201d98d9d66835626677f29eae88589621a..bef2973fe27b9e1dda3b2d3a193676007ac801cd 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/ColorSwatch.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/ColorSwatch.js
@@ -93,7 +93,7 @@ WebInspector.ColorSwatch.prototype = {
this._swatchInner = this._iconElement.createChild("span", "color-swatch-inner");
this._swatchInner.addEventListener("dblclick", consumeEvent, false);
this._swatchInner.addEventListener("mousedown", consumeEvent, false);
- this._swatchInner.addEventListener("click", this._handleClick.bind(this), true);
+ this._swatchInner.addEventListener("click", this._onClick.bind(this), true);
root.createChild("content");
this._colorValueElement = this.createChild("span");
@@ -104,6 +104,14 @@ WebInspector.ColorSwatch.prototype = {
/**
* @param {!Event} event
*/
+ _onClick: function(event)
+ {
+ this._handleClick(event);
+ },
+
+ /**
+ * @param {!Event} event
+ */
_handleClick: function(event)
{
if (!event.shiftKey)
@@ -112,6 +120,14 @@ WebInspector.ColorSwatch.prototype = {
event.consume(true);
},
+ /**
+ * @param {function(!Event)} clickHandler
+ */
+ setClickHandler: function(clickHandler)
lushnikov 2016/07/19 21:12:16 let's just not handle clicks in the WI.ColorSwatch
flandy 2016/07/19 22:58:15 Removed for now since I have removed support for s
lushnikov 2016/07/20 00:49:23 Sounds good for me
+ {
+ this._handleClick = clickHandler;
+ },
+
__proto__: HTMLSpanElement.prototype
}

Powered by Google App Engine
This is Rietveld 408576698