| 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 77571efd34840713a53eec7ba77249e7eaa32403..571e168a781b957039be613310e00c6b73b41f37 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js
|
| @@ -722,25 +722,27 @@ Elements.StylePropertiesSection = class {
|
| var items = [];
|
|
|
| var textShadowButton = new UI.ToolbarButton(Common.UIString('Add text-shadow'), 'largeicon-text-shadow');
|
| - textShadowButton.addEventListener('click', this._onInsertShadowPropertyClick.bind(this, 'text-shadow'));
|
| + textShadowButton.addEventListener(
|
| + UI.ToolbarButton.Events.Click, this._onInsertShadowPropertyClick.bind(this, 'text-shadow'));
|
| items.push(textShadowButton);
|
|
|
| var boxShadowButton = new UI.ToolbarButton(Common.UIString('Add box-shadow'), 'largeicon-box-shadow');
|
| - boxShadowButton.addEventListener('click', this._onInsertShadowPropertyClick.bind(this, 'box-shadow'));
|
| + boxShadowButton.addEventListener(
|
| + UI.ToolbarButton.Events.Click, this._onInsertShadowPropertyClick.bind(this, 'box-shadow'));
|
| items.push(boxShadowButton);
|
|
|
| var colorButton = new UI.ToolbarButton(Common.UIString('Add color'), 'largeicon-foreground-color');
|
| - colorButton.addEventListener('click', this._onInsertColorPropertyClick.bind(this));
|
| + colorButton.addEventListener(UI.ToolbarButton.Events.Click, this._onInsertColorPropertyClick, this);
|
| items.push(colorButton);
|
|
|
| var backgroundButton = new UI.ToolbarButton(Common.UIString('Add background-color'), 'largeicon-background-color');
|
| - backgroundButton.addEventListener('click', this._onInsertBackgroundColorPropertyClick.bind(this));
|
| + backgroundButton.addEventListener(UI.ToolbarButton.Events.Click, this._onInsertBackgroundColorPropertyClick, this);
|
| items.push(backgroundButton);
|
|
|
| var newRuleButton = null;
|
| if (this._style.parentRule) {
|
| newRuleButton = new UI.ToolbarButton(Common.UIString('Insert Style Rule Below'), 'largeicon-add');
|
| - newRuleButton.addEventListener('click', this._onNewRuleClick.bind(this));
|
| + newRuleButton.addEventListener(UI.ToolbarButton.Events.Click, this._onNewRuleClick, this);
|
| items.push(newRuleButton);
|
| }
|
|
|
| @@ -883,7 +885,7 @@ Elements.StylePropertiesSection = class {
|
| * @param {!Common.Event} event
|
| */
|
| _onNewRuleClick(event) {
|
| - event.consume();
|
| + event.data.consume();
|
| var rule = this._style.parentRule;
|
| var range = Common.TextRange.createFromLocation(rule.style.range.endLine, rule.style.range.endColumn + 1);
|
| this._parentPane._addBlankSection(this, /** @type {string} */ (rule.styleSheetId), range);
|
| @@ -894,7 +896,7 @@ Elements.StylePropertiesSection = class {
|
| * @param {!Common.Event} event
|
| */
|
| _onInsertShadowPropertyClick(propertyName, event) {
|
| - event.consume(true);
|
| + event.data.consume(true);
|
| var treeElement = this.addNewBlankProperty();
|
| treeElement.property.name = propertyName;
|
| treeElement.property.value = '0 0 black';
|
| @@ -908,7 +910,7 @@ Elements.StylePropertiesSection = class {
|
| * @param {!Common.Event} event
|
| */
|
| _onInsertColorPropertyClick(event) {
|
| - event.consume(true);
|
| + event.data.consume(true);
|
| var treeElement = this.addNewBlankProperty();
|
| treeElement.property.name = 'color';
|
| treeElement.property.value = 'black';
|
| @@ -922,7 +924,7 @@ Elements.StylePropertiesSection = class {
|
| * @param {!Common.Event} event
|
| */
|
| _onInsertBackgroundColorPropertyClick(event) {
|
| - event.consume(true);
|
| + event.data.consume(true);
|
| var treeElement = this.addNewBlankProperty();
|
| treeElement.property.name = 'background-color';
|
| treeElement.property.value = 'white';
|
| @@ -3019,7 +3021,7 @@ Elements.StylesSidebarPropertyRenderer = class {
|
| Elements.StylesSidebarPane.ButtonProvider = class {
|
| constructor() {
|
| this._button = new UI.ToolbarButton(Common.UIString('New Style Rule'), 'largeicon-add');
|
| - this._button.addEventListener('click', this._clicked, this);
|
| + this._button.addEventListener(UI.ToolbarButton.Events.Click, this._clicked, this);
|
| var longclickTriangle = UI.Icon.create('largeicon-longclick-triangle', 'long-click-glyph');
|
| this._button.element.appendChild(longclickTriangle);
|
|
|
| @@ -3037,7 +3039,10 @@ Elements.StylesSidebarPane.ButtonProvider = class {
|
| }
|
| }
|
|
|
| - _clicked() {
|
| + /**
|
| + * @param {!Common.Event} event
|
| + */
|
| + _clicked(event) {
|
| Elements.StylesSidebarPane._instance._createNewRuleInViaInspectorStyleSheet();
|
| }
|
|
|
|
|