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

Unified Diff: third_party/WebKit/Source/devtools/front_end/elements/ColorSwatchPopoverIcon.js

Issue 2324313002: DevTools: Add buttons to add box-shadow and text-shadow properties in SSP (Closed)
Patch Set: Rename function 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/elements/ColorSwatchPopoverIcon.js
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/ColorSwatchPopoverIcon.js b/third_party/WebKit/Source/devtools/front_end/elements/ColorSwatchPopoverIcon.js
index 2694eb9b48235335f6fb5896ff70a02fefd4a354..111707f9bc5ce33aa783a76926aea2b30b2fb0ba 100644
--- a/third_party/WebKit/Source/devtools/front_end/elements/ColorSwatchPopoverIcon.js
+++ b/third_party/WebKit/Source/devtools/front_end/elements/ColorSwatchPopoverIcon.js
@@ -224,6 +224,7 @@ WebInspector.ColorSwatchPopoverIcon.prototype = {
WebInspector.ShadowSwatchPopoverHelper = function(treeElement, swatchPopoverHelper, shadowSwatch)
{
this._treeElement = treeElement;
+ this._treeElement[WebInspector.ShadowSwatchPopoverHelper._treeElementSymbol] = this;
this._swatchPopoverHelper = swatchPopoverHelper;
this._shadowSwatch = shadowSwatch;
this._iconElement = shadowSwatch.iconElement();
@@ -235,6 +236,17 @@ WebInspector.ShadowSwatchPopoverHelper = function(treeElement, swatchPopoverHelp
this._boundOnScroll = this._onScroll.bind(this);
}
+WebInspector.ShadowSwatchPopoverHelper._treeElementSymbol = Symbol("WebInspector.ShadowSwatchPopoverHelper._treeElementSymbol");
+
+/**
+ * @param {!WebInspector.StylePropertyTreeElement} treeElement
+ * @return {?WebInspector.ShadowSwatchPopoverHelper}
+ */
+WebInspector.ShadowSwatchPopoverHelper.forTreeElement = function(treeElement)
+{
+ return treeElement[WebInspector.ShadowSwatchPopoverHelper._treeElementSymbol] || null;
+}
+
WebInspector.ShadowSwatchPopoverHelper.prototype = {
/**
* @param {!Event} event
@@ -242,6 +254,11 @@ WebInspector.ShadowSwatchPopoverHelper.prototype = {
_iconClick: function(event)
{
event.consume(true);
+ this.showPopover();
+ },
+
+ showPopover: function()
+ {
if (this._swatchPopoverHelper.isShowing()) {
this._swatchPopoverHelper.hide(true);
return;

Powered by Google App Engine
This is Rietveld 408576698