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

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: 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..9434c47c678b79573928d3ec95a9ddc24b599eaa 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/ColorSwatch.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/ColorSwatch.js
@@ -43,6 +43,14 @@ WebInspector.ColorSwatch.prototype = {
},
/**
+ * @return {string}
+ */
+ getColorText: function()
+ {
+ return this._colorValueElement.textContent;
lushnikov 2016/07/16 00:30:26 no need for the new method: colorSwatch.color().a
flandy 2016/07/19 17:52:19 Done.
+ },
+
+ /**
* @param {boolean} hide
*/
hideText: function(hide)
@@ -93,7 +101,8 @@ 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._boundHandleClick = this._handleClick.bind(this);
+ this._swatchInner.addEventListener("click", this._boundHandleClick, true);
root.createChild("content");
this._colorValueElement = this.createChild("span");
@@ -112,6 +121,11 @@ WebInspector.ColorSwatch.prototype = {
event.consume(true);
},
+ removeClickListener: function()
+ {
+ this._swatchInner.removeEventListener("click", this._boundHandleClick, true);
+ },
+
__proto__: HTMLSpanElement.prototype
}

Powered by Google App Engine
This is Rietveld 408576698