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

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

Issue 2560553004: Revert of [DevTools] Remove methods on Common.Event. (Closed)
Patch Set: Created 4 years 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 571e168a781b957039be613310e00c6b73b41f37..77571efd34840713a53eec7ba77249e7eaa32403 100644
--- a/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js
+++ b/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js
@@ -722,27 +722,25 @@
var items = [];
var textShadowButton = new UI.ToolbarButton(Common.UIString('Add text-shadow'), 'largeicon-text-shadow');
- textShadowButton.addEventListener(
- UI.ToolbarButton.Events.Click, this._onInsertShadowPropertyClick.bind(this, 'text-shadow'));
+ textShadowButton.addEventListener('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(
- UI.ToolbarButton.Events.Click, this._onInsertShadowPropertyClick.bind(this, 'box-shadow'));
+ boxShadowButton.addEventListener('click', this._onInsertShadowPropertyClick.bind(this, 'box-shadow'));
items.push(boxShadowButton);
var colorButton = new UI.ToolbarButton(Common.UIString('Add color'), 'largeicon-foreground-color');
- colorButton.addEventListener(UI.ToolbarButton.Events.Click, this._onInsertColorPropertyClick, this);
+ colorButton.addEventListener('click', this._onInsertColorPropertyClick.bind(this));
items.push(colorButton);
var backgroundButton = new UI.ToolbarButton(Common.UIString('Add background-color'), 'largeicon-background-color');
- backgroundButton.addEventListener(UI.ToolbarButton.Events.Click, this._onInsertBackgroundColorPropertyClick, this);
+ backgroundButton.addEventListener('click', this._onInsertBackgroundColorPropertyClick.bind(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(UI.ToolbarButton.Events.Click, this._onNewRuleClick, this);
+ newRuleButton.addEventListener('click', this._onNewRuleClick.bind(this));
items.push(newRuleButton);
}
@@ -885,7 +883,7 @@
* @param {!Common.Event} event
*/
_onNewRuleClick(event) {
- event.data.consume();
+ event.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);
@@ -896,7 +894,7 @@
* @param {!Common.Event} event
*/
_onInsertShadowPropertyClick(propertyName, event) {
- event.data.consume(true);
+ event.consume(true);
var treeElement = this.addNewBlankProperty();
treeElement.property.name = propertyName;
treeElement.property.value = '0 0 black';
@@ -910,7 +908,7 @@
* @param {!Common.Event} event
*/
_onInsertColorPropertyClick(event) {
- event.data.consume(true);
+ event.consume(true);
var treeElement = this.addNewBlankProperty();
treeElement.property.name = 'color';
treeElement.property.value = 'black';
@@ -924,7 +922,7 @@
* @param {!Common.Event} event
*/
_onInsertBackgroundColorPropertyClick(event) {
- event.data.consume(true);
+ event.consume(true);
var treeElement = this.addNewBlankProperty();
treeElement.property.name = 'background-color';
treeElement.property.value = 'white';
@@ -3021,7 +3019,7 @@
Elements.StylesSidebarPane.ButtonProvider = class {
constructor() {
this._button = new UI.ToolbarButton(Common.UIString('New Style Rule'), 'largeicon-add');
- this._button.addEventListener(UI.ToolbarButton.Events.Click, this._clicked, this);
+ this._button.addEventListener('click', this._clicked, this);
var longclickTriangle = UI.Icon.create('largeicon-longclick-triangle', 'long-click-glyph');
this._button.element.appendChild(longclickTriangle);
@@ -3039,10 +3037,7 @@
}
}
- /**
- * @param {!Common.Event} event
- */
- _clicked(event) {
+ _clicked() {
Elements.StylesSidebarPane._instance._createNewRuleInViaInspectorStyleSheet();
}

Powered by Google App Engine
This is Rietveld 408576698