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

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: Resolve black box 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..ac380ede5686bf8cd313d18360c2f399c78971e3 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._onInsertTextShadowPropertyClick.bind(this));
lushnikov 2016/09/10 00:17:23 this._onShadowButtonClick.bind(this, "text-shadow"
flandy 2016/09/10 00:26:04 Done.
+ items.push(textShadowButton);
+
+ var boxShadowButton = new WebInspector.ToolbarButton(WebInspector.UIString("Add box-shadow"), "box-shadow-toolbar-item");
+ boxShadowButton.addEventListener("click", this._onInsertBoxShadowPropertyClick.bind(this));
+ 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);
@@ -884,6 +893,36 @@ WebInspector.StylePropertiesSection.prototype = {
/**
* @param {!WebInspector.Event} event
*/
+ _onInsertTextShadowPropertyClick: function(event)
lushnikov 2016/09/10 00:17:23 onShadowButtonClick: function(text, shadow) { ...
flandy 2016/09/10 00:26:04 Done.
+ {
+ event.consume(true);
+ var treeElement = this.addNewBlankProperty();
+ treeElement.property.name = "text-shadow";
+ treeElement.property.value = "0 0 black";
+ treeElement.updateTitle();
+ var shadowSwatchPopoverHelper = WebInspector.ShadowSwatchPopoverHelper.forTreeElement(treeElement);
+ if (shadowSwatchPopoverHelper)
+ shadowSwatchPopoverHelper.showPopover();
+ },
+
+ /**
+ * @param {!WebInspector.Event} event
+ */
+ _onInsertBoxShadowPropertyClick: function(event)
+ {
+ event.consume(true);
+ var treeElement = this.addNewBlankProperty();
+ treeElement.property.name = "box-shadow";
+ 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)
{
event.consume(true);

Powered by Google App Engine
This is Rietveld 408576698