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

Unified Diff: ui/webui/resources/js/cr/ui/list_single_selection_model.js

Issue 2603443002: Clang format JS: Disallow single line functions, conditionals, loops, and switch statements (Closed)
Patch Set: update c/b/r/ as well 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
« no previous file with comments | « ui/webui/resources/js/cr/ui/list_selection_model.js ('k') | ui/webui/resources/js/cr/ui/menu.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/webui/resources/js/cr/ui/list_single_selection_model.js
diff --git a/ui/webui/resources/js/cr/ui/list_single_selection_model.js b/ui/webui/resources/js/cr/ui/list_single_selection_model.js
index a5676496b03113bd8d62ee3b1a0117dfb9ada27f..15865d0363eb8d0ca2d09179bf2a580aa7f7d383 100644
--- a/ui/webui/resources/js/cr/ui/list_single_selection_model.js
+++ b/ui/webui/resources/js/cr/ui/list_single_selection_model.js
@@ -29,7 +29,9 @@ cr.define('cr.ui', function() {
* The number of items in the model.
* @type {number}
*/
- get length() { return this.length_; },
+ get length() {
+ return this.length_;
+ },
/**
* @type {!Array} The selected indexes.
@@ -47,7 +49,9 @@ cr.define('cr.ui', function() {
* Setter also changes lead and anchor indexes if value is nonegative.
* @type {number}
*/
- get selectedIndex() { return this.selectedIndex_; },
+ get selectedIndex() {
+ return this.selectedIndex_;
+ },
set selectedIndex(selectedIndex) {
var oldSelectedIndex = this.selectedIndex;
var i = Math.max(-1, Math.min(this.length_ - 1, selectedIndex));
@@ -91,7 +95,9 @@ cr.define('cr.ui', function() {
/**
* Unselects all selected items.
*/
- unselectAll: function() { this.selectedIndex = -1; },
+ unselectAll: function() {
+ this.selectedIndex = -1;
+ },
/**
* Sets the selected state for an index.
@@ -115,7 +121,9 @@ cr.define('cr.ui', function() {
* @param {number} index The index to check.
* @return {boolean} Whether an index is selected.
*/
- getIndexSelected: function(index) { return index == this.selectedIndex_; },
+ getIndexSelected: function(index) {
+ return index == this.selectedIndex_;
+ },
/**
* This is used to begin batching changes. Call {@code endChange} when you
@@ -154,7 +162,10 @@ cr.define('cr.ui', function() {
var e = new Event(eventName);
var indexes = [this.selectedIndexBefore_, this.selectedIndex_];
e.changes =
- indexes.filter(function(index) { return index != -1; })
+ indexes
+ .filter(function(index) {
+ return index != -1;
+ })
.map(function(index) {
return {index: index, selected: index == this.selectedIndex_};
}, this);
@@ -169,7 +180,9 @@ cr.define('cr.ui', function() {
* the user is moving using the arrow keys.
* @type {number}
*/
- get leadIndex() { return this.leadIndex_; },
+ get leadIndex() {
+ return this.leadIndex_;
+ },
set leadIndex(leadIndex) {
var li = this.adjustIndex_(leadIndex);
if (li != this.leadIndex_) {
@@ -191,14 +204,20 @@ cr.define('cr.ui', function() {
* The anchorIndex is used with multiple selection.
* @type {number}
*/
- get anchorIndex() { return this.leadIndex; },
- set anchorIndex(anchorIndex) { this.leadIndex = anchorIndex; },
+ get anchorIndex() {
+ return this.leadIndex;
+ },
+ set anchorIndex(anchorIndex) {
+ this.leadIndex = anchorIndex;
+ },
/**
* Whether the selection model supports multiple selected items.
* @type {boolean}
*/
- get multiple() { return false; },
+ get multiple() {
+ return false;
+ },
/**
* Adjusts the selection after reordering of items in the table.
@@ -218,7 +237,9 @@ cr.define('cr.ui', function() {
* Adjusts selection model length.
* @param {number} length New selection model length.
*/
- adjustLength: function(length) { this.length_ = length; }
+ adjustLength: function(length) {
+ this.length_ = length;
+ }
};
return {ListSingleSelectionModel: ListSingleSelectionModel};
« no previous file with comments | « ui/webui/resources/js/cr/ui/list_selection_model.js ('k') | ui/webui/resources/js/cr/ui/menu.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698