Chromium Code Reviews| 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 |
| } |