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

Side by Side Diff: ui/webui/resources/js/cr/ui/focus_row.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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 cr.define('cr.ui', function() { 5 cr.define('cr.ui', function() {
6 /** 6 /**
7 * A class to manage focus between given horizontally arranged elements. 7 * A class to manage focus between given horizontally arranged elements.
8 * 8 *
9 * Pressing left cycles backward and pressing right cycles forward in item 9 * Pressing left cycles backward and pressing right cycles forward in item
10 * order. Pressing Home goes to the beginning of the list and End goes to the 10 * order. Pressing Home goes to the beginning of the list and End goes to the
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 element.tabIndex = this.isActive() ? 0 : -1; 119 element.tabIndex = this.isActive() ? 0 : -1;
120 120
121 this.eventTracker.add(element, 'blur', this.onBlur_.bind(this)); 121 this.eventTracker.add(element, 'blur', this.onBlur_.bind(this));
122 this.eventTracker.add(element, 'focus', this.onFocus_.bind(this)); 122 this.eventTracker.add(element, 'focus', this.onFocus_.bind(this));
123 this.eventTracker.add(element, 'keydown', this.onKeydown_.bind(this)); 123 this.eventTracker.add(element, 'keydown', this.onKeydown_.bind(this));
124 this.eventTracker.add(element, 'mousedown', this.onMousedown_.bind(this)); 124 this.eventTracker.add(element, 'mousedown', this.onMousedown_.bind(this));
125 return true; 125 return true;
126 }, 126 },
127 127
128 /** Dereferences nodes and removes event handlers. */ 128 /** Dereferences nodes and removes event handlers. */
129 destroy: function() { this.eventTracker.removeAll(); }, 129 destroy: function() {
130 this.eventTracker.removeAll();
131 },
130 132
131 /** 133 /**
132 * @param {!Element} sampleElement An element for to find an equivalent for. 134 * @param {!Element} sampleElement An element for to find an equivalent for.
133 * @return {!Element} An equivalent element to focus for |sampleElement|. 135 * @return {!Element} An equivalent element to focus for |sampleElement|.
134 * @protected 136 * @protected
135 */ 137 */
136 getCustomEquivalent: function(sampleElement) { 138 getCustomEquivalent: function(sampleElement) {
137 return assert(this.getFirstFocusable()); 139 return assert(this.getFirstFocusable());
138 }, 140 },
139 141
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 this.getEquivalentElement(elementToFocus).focus(); 284 this.getEquivalentElement(elementToFocus).focus();
283 e.preventDefault(); 285 e.preventDefault();
284 } 286 }
285 }, 287 },
286 }; 288 };
287 289
288 return { 290 return {
289 FocusRow: FocusRow, 291 FocusRow: FocusRow,
290 }; 292 };
291 }); 293 });
OLDNEW
« no previous file with comments | « ui/webui/resources/js/cr/ui/focus_outline_manager.js ('k') | ui/webui/resources/js/cr/ui/grid.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698