| Index: ui/webui/resources/js/cr/ui/list_selection_controller.js
|
| diff --git a/ui/webui/resources/js/cr/ui/list_selection_controller.js b/ui/webui/resources/js/cr/ui/list_selection_controller.js
|
| index b2a7abf580dc86646c0f1de61dd888d3d1124910..ef925ea4c4f94eb96b61c4d51cf62eb39d1fd317 100644
|
| --- a/ui/webui/resources/js/cr/ui/list_selection_controller.js
|
| +++ b/ui/webui/resources/js/cr/ui/list_selection_controller.js
|
| @@ -26,9 +26,7 @@ cr.define('cr.ui', function() {
|
| * The selection model we are interacting with.
|
| * @type {cr.ui.ListSelectionModel}
|
| */
|
| - get selectionModel() {
|
| - return this.selectionModel_;
|
| - },
|
| + get selectionModel() { return this.selectionModel_; },
|
|
|
| /**
|
| * Returns the index below (y axis) the given element.
|
| @@ -46,9 +44,7 @@ cr.define('cr.ui', function() {
|
| * @param {number} index The index to get the index above.
|
| * @return {number} The index below or -1 if not found.
|
| */
|
| - getIndexAbove: function(index) {
|
| - return index - 1;
|
| - },
|
| + getIndexAbove: function(index) { return index - 1; },
|
|
|
| /**
|
| * Returns the index before (x axis) the given element. This returns -1
|
| @@ -58,9 +54,7 @@ cr.define('cr.ui', function() {
|
| * @param {number} index The index to get the index before.
|
| * @return {number} The index before or -1 if not found.
|
| */
|
| - getIndexBefore: function(index) {
|
| - return -1;
|
| - },
|
| + getIndexBefore: function(index) { return -1; },
|
|
|
| /**
|
| * Returns the index after (x axis) the given element. This returns -1
|
| @@ -70,9 +64,7 @@ cr.define('cr.ui', function() {
|
| * @param {number} index The index to get the index after.
|
| * @return {number} The index after or -1 if not found.
|
| */
|
| - getIndexAfter: function(index) {
|
| - return -1;
|
| - },
|
| + getIndexAfter: function(index) { return -1; },
|
|
|
| /**
|
| * Returns the next list index. This is the next logical and should not
|
| @@ -92,23 +84,17 @@ cr.define('cr.ui', function() {
|
| * @param {number} index The index to get the previous index for.
|
| * @return {number} The previous index or -1 if not found.
|
| */
|
| - getPreviousIndex: function(index) {
|
| - return index - 1;
|
| - },
|
| + getPreviousIndex: function(index) { return index - 1; },
|
|
|
| /**
|
| * @return {number} The first index.
|
| */
|
| - getFirstIndex: function() {
|
| - return 0;
|
| - },
|
| + getFirstIndex: function() { return 0; },
|
|
|
| /**
|
| * @return {number} The last index.
|
| */
|
| - getLastIndex: function() {
|
| - return this.selectionModel.length - 1;
|
| - },
|
| + getLastIndex: function() { return this.selectionModel.length - 1; },
|
|
|
| /**
|
| * Called by the view when the user does a mousedown or mouseup on the
|
| @@ -137,8 +123,8 @@ cr.define('cr.ui', function() {
|
| if (sm.multiple)
|
| sm.unselectAll();
|
| } else {
|
| - if (sm.multiple && (cr.isMac ? e.metaKey :
|
| - (e.ctrlKey && !e.shiftKey))) {
|
| + if (sm.multiple &&
|
| + (cr.isMac ? e.metaKey : (e.ctrlKey && !e.shiftKey))) {
|
| // Selection is handled at mouseUp on windows/linux, mouseDown on mac.
|
| if (cr.isMac ? isDown : !isDown) {
|
| // Toggle the current one and make it anchor index.
|
| @@ -187,7 +173,8 @@ cr.define('cr.ui', function() {
|
| if (inputType == 'checkbox' || inputType == 'radio') {
|
| if (e.key == ' ')
|
| return;
|
| - // Protect all but the most basic navigation commands in anything else.
|
| + // Protect all but the most basic navigation commands in anything
|
| + // else.
|
| } else if (e.key != 'ArrowUp' && e.key != 'ArrowDown') {
|
| return;
|
| }
|
| @@ -227,22 +214,22 @@ cr.define('cr.ui', function() {
|
| newIndex = this.getLastIndex();
|
| break;
|
| case 'ArrowUp':
|
| - newIndex = leadIndex == -1 ?
|
| - this.getLastIndex() : this.getIndexAbove(leadIndex);
|
| + newIndex = leadIndex == -1 ? this.getLastIndex() :
|
| + this.getIndexAbove(leadIndex);
|
| break;
|
| case 'ArrowDown':
|
| - newIndex = leadIndex == -1 ?
|
| - this.getFirstIndex() : this.getIndexBelow(leadIndex);
|
| + newIndex = leadIndex == -1 ? this.getFirstIndex() :
|
| + this.getIndexBelow(leadIndex);
|
| break;
|
| case 'ArrowLeft':
|
| case 'MediaPreviousTrack':
|
| - newIndex = leadIndex == -1 ?
|
| - this.getLastIndex() : this.getIndexBefore(leadIndex);
|
| + newIndex = leadIndex == -1 ? this.getLastIndex() :
|
| + this.getIndexBefore(leadIndex);
|
| break;
|
| case 'ArrowRight':
|
| case 'MediaNextTrack':
|
| - newIndex = leadIndex == -1 ?
|
| - this.getFirstIndex() : this.getIndexAfter(leadIndex);
|
| + newIndex = leadIndex == -1 ? this.getFirstIndex() :
|
| + this.getIndexAfter(leadIndex);
|
| break;
|
| default:
|
| prevent = false;
|
| @@ -280,7 +267,5 @@ cr.define('cr.ui', function() {
|
| }
|
| };
|
|
|
| - return {
|
| - ListSelectionController: ListSelectionController
|
| - };
|
| + return {ListSelectionController: ListSelectionController};
|
| });
|
|
|