Chromium Code Reviews| 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); |