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

Unified Diff: tracing/tracing/ui/side_panel/side_panel_container.html

Issue 2776653002: [ESLint] Fix violations when enabling curly rule in eslint. (Closed)
Patch Set: Fix test Created 3 years, 9 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: tracing/tracing/ui/side_panel/side_panel_container.html
diff --git a/tracing/tracing/ui/side_panel/side_panel_container.html b/tracing/tracing/ui/side_panel/side_panel_container.html
index 066191843dc596e97c464d0d10e30f40d7153691..d3679154cce16631784fd6bdc0680adf0dbb1782 100644
--- a/tracing/tracing/ui/side_panel/side_panel_container.html
+++ b/tracing/tracing/ui/side_panel/side_panel_container.html
@@ -117,8 +117,9 @@ Polymer({
},
onSelectionChanged_: function() {
- if (this.activePanel)
+ if (this.activePanel) {
this.activePanel.selection = this.selection;
+ }
},
get model() {
@@ -143,15 +144,18 @@ Polymer({
},
set activePanelType(panelType) {
- if (this.model === undefined)
+ if (this.model === undefined) {
throw new Error('Cannot activate panel without a model');
+ }
var panel = undefined;
- if (panelType)
+ if (panelType) {
panel = document.createElement(panelType);
+ }
- if (panel !== undefined && !panel.supportsModel(this.model))
+ if (panel !== undefined && !panel.supportsModel(this.model)) {
throw new Error('Cannot activate panel: does not support this model');
+ }
if (this.activePanelType) {
Polymer.dom(this.getLabelElementForPanelType_(
@@ -163,8 +167,9 @@ Polymer({
this.activePanelType).removeAttribute('selected');
}
- if (this.activePanel)
+ if (this.activePanel) {
this.activePanelContainer_.removeChild(this.activePanel);
+ }
if (panelType === undefined) {
Polymer.dom(this).removeAttribute('expanded');
@@ -186,15 +191,17 @@ Polymer({
getPanelTypeForConstructor_: function(constructor) {
for (var i = 0; i < this.tabStrip_.children.length; i++) {
- if (this.tabStrip_.children[i].panelType.constructor === constructor)
+ if (this.tabStrip_.children[i].panelType.constructor === constructor) {
return this.tabStrip_.children[i].panelType;
+ }
}
},
getLabelElementForPanelType_: function(panelType) {
for (var i = 0; i < this.tabStrip_.children.length; i++) {
- if (this.tabStrip_.children[i].panelType === panelType)
+ if (this.tabStrip_.children[i].panelType === panelType) {
return this.tabStrip_.children[i];
+ }
}
return undefined;
},
@@ -223,8 +230,9 @@ Polymer({
this.activePanelType === panelType ? undefined : panelType;
}.bind(this, panelType));
} else {
- if (this.activePanel)
+ if (this.activePanel) {
this.activePanelContainer_.removeChild(this.activePanel);
+ }
this.removeAttribute('expanded');
}
Polymer.dom(this.tabStrip_).appendChild(labelEl);
@@ -236,8 +244,9 @@ Polymer({
this.activePanelType = previouslyActivePanelType;
Polymer.dom(this).setAttribute('expanded', true);
} else {
- if (this.activePanel)
+ if (this.activePanel) {
Polymer.dom(this.activePanelContainer_).removeChild(this.activePanel);
+ }
Polymer.dom(this).removeAttribute('expanded');
}
},
@@ -247,11 +256,13 @@ Polymer({
},
set rangeOfInterest(range) {
- if (range === undefined)
+ if (range === undefined) {
throw new Error('Must not be undefined');
+ }
this.rangeOfInterest_ = range;
- if (this.activePanel)
+ if (this.activePanel) {
this.activePanel.rangeOfInterest = range;
+ }
}
});
</script>

Powered by Google App Engine
This is Rietveld 408576698