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

Unified Diff: third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.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/StylesSidebarPane.js
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js b/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js
index 4fb7c8672b331160dc287ae63362fefc69718e98..114aea4843ea7602a792872ebcfc7abd8da6e9c4 100644
--- a/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js
+++ b/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js
@@ -710,6 +710,15 @@ WebInspector.StylePropertiesSection.prototype = {
if (!this.editable)
return;
var items = [];
+
+ var textShadowButton = new WebInspector.ToolbarButton(WebInspector.UIString("Add text-shadow"), "text-shadow-toolbar-item");
+ textShadowButton.addEventListener("click", this._onInsertShadowPropertyClick.bind(this, "text-shadow"));
+ items.push(textShadowButton);
+
+ var boxShadowButton = new WebInspector.ToolbarButton(WebInspector.UIString("Add box-shadow"), "box-shadow-toolbar-item");
+ boxShadowButton.addEventListener("click", this._onInsertShadowPropertyClick.bind(this, "box-shadow"));
+ items.push(boxShadowButton);
+
var colorButton = new WebInspector.ToolbarButton(WebInspector.UIString("Add color"), "foreground-color-toolbar-item");
colorButton.addEventListener("click", this._onInsertColorPropertyClick.bind(this));
items.push(colorButton);
@@ -882,6 +891,22 @@ WebInspector.StylePropertiesSection.prototype = {
},
/**
+ * @param {string} propertyName
+ * @param {!WebInspector.Event} event
+ */
+ _onInsertShadowPropertyClick: function(propertyName, event)
+ {
+ event.consume(true);
+ var treeElement = this.addNewBlankProperty();
+ treeElement.property.name = propertyName;
+ treeElement.property.value = "0 0 black";
+ treeElement.updateTitle();
+ var shadowSwatchPopoverHelper = WebInspector.ShadowSwatchPopoverHelper.forTreeElement(treeElement);
+ if (shadowSwatchPopoverHelper)
+ shadowSwatchPopoverHelper.showPopover();
+ },
+
+ /**
* @param {!WebInspector.Event} event
*/
_onInsertColorPropertyClick: function(event)

Powered by Google App Engine
This is Rietveld 408576698