| Index: ui/webui/resources/js/cr/ui/grid.js
|
| diff --git a/ui/webui/resources/js/cr/ui/grid.js b/ui/webui/resources/js/cr/ui/grid.js
|
| index 6d7ba8c079193569de6a188abfdf7615305f3dcb..aa0b92887db0d333572f50aeee79105f7c313e86 100644
|
| --- a/ui/webui/resources/js/cr/ui/grid.js
|
| +++ b/ui/webui/resources/js/cr/ui/grid.js
|
| @@ -73,9 +73,7 @@ cr.define('cr.ui', function() {
|
| * Shows a warning at the setter because cr.ui.Grid does not support this.
|
| * @type {boolean}
|
| */
|
| - get fixedHeight() {
|
| - return true;
|
| - },
|
| + get fixedHeight() { return true; },
|
| set fixedHeight(fixedHeight) {
|
| if (!fixedHeight)
|
| console.warn('cr.ui.Grid does not support fixedHeight = false');
|
| @@ -208,18 +206,14 @@ cr.define('cr.ui', function() {
|
| * of multiple columns.
|
| * @override
|
| */
|
| - getItemRow: function(index) {
|
| - return Math.floor(index / this.columns);
|
| - },
|
| + getItemRow: function(index) { return Math.floor(index / this.columns); },
|
|
|
| /**
|
| * @param {number} row The row.
|
| * @return {number} The index of the first item in the row.
|
| * @override
|
| */
|
| - getFirstItemInRow: function(row) {
|
| - return row * this.columns;
|
| - },
|
| + getFirstItemInRow: function(row) { return row * this.columns; },
|
|
|
| /**
|
| * Creates the selection controller to use internally.
|
| @@ -245,16 +239,14 @@ cr.define('cr.ui', function() {
|
| var firstIndex =
|
| this.autoExpands ? 0 : this.getIndexForListOffset_(scrollTop);
|
| var columns = this.columns;
|
| - var count = this.autoExpands_ ? this.dataModel.length : Math.max(
|
| - columns * (Math.ceil(clientHeight / itemHeight) + 1),
|
| - this.countItemsInRange_(firstIndex, scrollTop + clientHeight));
|
| + var count = this.autoExpands_ ?
|
| + this.dataModel.length :
|
| + Math.max(
|
| + columns * (Math.ceil(clientHeight / itemHeight) + 1),
|
| + this.countItemsInRange_(firstIndex, scrollTop + clientHeight));
|
| count = columns * Math.ceil(count / columns);
|
| count = Math.min(count, this.dataModel.length - firstIndex);
|
| - return {
|
| - first: firstIndex,
|
| - length: count,
|
| - last: firstIndex + count - 1
|
| - };
|
| + return {first: firstIndex, length: count, last: firstIndex + count - 1};
|
| },
|
|
|
| /**
|
| @@ -301,7 +293,7 @@ cr.define('cr.ui', function() {
|
|
|
| function isSpacer(child) {
|
| return child.classList.contains('spacer') &&
|
| - child != afterFiller; // Must not be removed.
|
| + child != afterFiller; // Must not be removed.
|
| }
|
| },
|
|
|
| @@ -329,7 +321,7 @@ cr.define('cr.ui', function() {
|
| isItem: function(child) {
|
| // Non-items are before-, afterFiller and spacers added in mergeItems.
|
| return child.nodeType == Node.ELEMENT_NODE &&
|
| - !child.classList.contains('spacer');
|
| + !child.classList.contains('spacer');
|
| },
|
|
|
| redraw: function() {
|
| @@ -371,8 +363,8 @@ cr.define('cr.ui', function() {
|
| */
|
| isAccessibilityEnabled: function() {
|
| return window.cvox && window.cvox.Api &&
|
| - window.cvox.Api.isChromeVoxActive &&
|
| - window.cvox.Api.isChromeVoxActive();
|
| + window.cvox.Api.isChromeVoxActive &&
|
| + window.cvox.Api.isChromeVoxActive();
|
| },
|
|
|
| /**
|
| @@ -412,9 +404,7 @@ cr.define('cr.ui', function() {
|
| * @return {number} The index before or -1 if not found.
|
| * @override
|
| */
|
| - getIndexBefore: function(index) {
|
| - return index - 1;
|
| - },
|
| + getIndexBefore: function(index) { return index - 1; },
|
|
|
| /**
|
| * Returns the index after (x axis) the given element.
|
|
|