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

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: rebase 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 47b75beba29e33bb8c337bcbd03b26b07fa5b686..cf8719ed1c9f57572ea392478642d790685858d6 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>
« no previous file with comments | « tracing/tracing/ui/side_panel/metrics_side_panel.html ('k') | tracing/tracing/ui/timeline_display_transform.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698