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

Unified Diff: tracing/tracing/ui/base/radio_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/quad_stack_view.html ('k') | tracing/tracing/ui/base/table.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/ui/base/radio_picker.html
diff --git a/tracing/tracing/ui/base/radio_picker.html b/tracing/tracing/ui/base/radio_picker.html
index 90edfc9a675542db12fd6b4827790196d41de22c..c19f213c46a5104b8eacdb0968391f217abf275b 100644
--- a/tracing/tracing/ui/base/radio_picker.html
+++ b/tracing/tracing/ui/base/radio_picker.html
@@ -55,10 +55,11 @@ Polymer({
},
set vertical(vertical) {
- if (vertical)
+ if (vertical) {
this.setAttribute('vertical', true);
- else
+ } else {
this.removeAttribute('vertical');
+ }
},
get settingsKey() {
@@ -66,17 +67,16 @@ 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.needsInit_) return;
+ if (this.settingsKey_ === undefined) return;
this.needsInit_ = false;
this.select(tr.b.Settings.get(this.settingsKey_));
},
@@ -84,8 +84,9 @@ Polymer({
set items(items) {
this.radioButtons_ = {};
items.forEach(function(e) {
- if (e.key in this.radioButtons_)
+ if (e.key in this.radioButtons_) {
throw new Error(e.key + ' already exists');
+ }
var radioButton = document.createElement('div');
var input = document.createElement('input');
var label = document.createElement('label');
@@ -107,33 +108,37 @@ Polymer({
},
maybeRenderRadioButtons_: function() {
- if (!this.isReady_)
- return;
- if (this.radioButtons_ === undefined)
- return;
- for (var key in this.radioButtons_)
+ if (!this.isReady_) return;
+ if (this.radioButtons_ === undefined) return;
+ for (var key in this.radioButtons_) {
Polymer.dom(this.$.container).appendChild(
this.radioButtons_[key].parentElement);
- if (this.selectedKey_ !== undefined)
+ }
+ if (this.selectedKey_ !== undefined) {
this.select(this.selectedKey_);
+ }
},
select: function(key) {
- if (key === undefined || key === this.selectedKey_)
+ if (key === undefined || key === this.selectedKey_) {
return;
+ }
if (this.radioButtons_ === undefined) {
this.selectedKey_ = key;
return;
}
- if (!(key in this.radioButtons_))
+ if (!(key in this.radioButtons_)) {
throw new Error(key + ' does not exists');
+ }
// Unselect the previous radio, update the key & select the new one.
- if (this.selectedKey_ !== undefined)
+ if (this.selectedKey_ !== undefined) {
this.radioButtons_[this.selectedKey_].checked = false;
+ }
this.selectedKey_ = key;
tr.b.Settings.set(this.settingsKey_, this.selectedKey_);
- if (this.selectedKey_ !== undefined)
+ if (this.selectedKey_ !== undefined) {
this.radioButtons_[this.selectedKey_].checked = true;
+ }
this.dispatchEvent(new tr.b.Event('change', false));
},
« no previous file with comments | « tracing/tracing/ui/base/quad_stack_view.html ('k') | tracing/tracing/ui/base/table.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698