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

Unified Diff: tracing/tracing/ui/base/checkbox_picker.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
« no previous file with comments | « tracing/tracing/ui/base/checkbox.html ('k') | tracing/tracing/ui/base/color_legend.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/ui/base/checkbox_picker.html
diff --git a/tracing/tracing/ui/base/checkbox_picker.html b/tracing/tracing/ui/base/checkbox_picker.html
index ddd2e8a52c8d2c4fcdc3ccb4904069b026776d6f..67e9cc50e95b65c0dc1ee627addc8abfb22f48cd 100644
--- a/tracing/tracing/ui/base/checkbox_picker.html
+++ b/tracing/tracing/ui/base/checkbox_picker.html
@@ -44,19 +44,17 @@ Polymer({
},
set settingsKey(settingsKey) {
- if (!this.needsInit_)
+ if (!this.needsInit_) {
throw new Error('Already initialized.');
+ }
this.settingsKey_ = settingsKey;
this.maybeInit_();
},
maybeInit_: function() {
- if (!this.needsInit_)
- return;
- if (this.settingsKey_ === undefined)
- return;
- if (this.checkboxes_ === undefined)
- return;
+ if (!this.needsInit_) return;
+ if (this.settingsKey_ === undefined) return;
+ if (this.checkboxes_ === undefined) return;
this.needsInit_ = false;
@@ -69,8 +67,9 @@ Polymer({
set items(items) {
this.checkboxes_ = {};
items.forEach(function(e) {
- if (e.key in this.checkboxes_)
+ if (e.key in this.checkboxes_) {
throw new Error(e.key + ' already exists');
+ }
var checkboxEl = document.createElement('tr-ui-b-checkbox');
checkboxEl.label = e.label;
this.checkboxes_[e.key] = checkboxEl;
@@ -80,23 +79,24 @@ Polymer({
},
maybeRenderCheckboxes_: function() {
- if (!this.is_ready_)
- return;
- if (this.checkboxes_ === undefined)
- return;
- for (var key in this.checkboxes_)
+ if (!this.is_ready_) return;
+ if (this.checkboxes_ === undefined) return;
+ for (var key in this.checkboxes_) {
Polymer.dom(this.$.container).appendChild(this.checkboxes_[key]);
+ }
},
selectCheckbox: function(key) {
- if (!(key in this.checkboxes_))
+ if (!(key in this.checkboxes_)) {
throw new Error(key + ' does not exists');
+ }
this.checkboxes_[key].checked = true;
},
unselectCheckbox: function(key) {
- if (!(key in this.checkboxes_))
+ if (!(key in this.checkboxes_)) {
throw new Error(key + ' does not exists');
+ }
this.checkboxes_[key].checked = false;
},
« no previous file with comments | « tracing/tracing/ui/base/checkbox.html ('k') | tracing/tracing/ui/base/color_legend.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698