From 8215e498a301bf9c4741d82ea7f1cfcda67b561d Mon Sep 17 00:00:00 2001 From: Kasper Nilsson Date: Sun, 14 May 2017 17:58:48 -0700 Subject: [PATCH] ES6ify /gr-change-table-behavior/* Bug: Issue 6179 Change-Id: Ib3ea20a7450afd1752caeffe408e00b0699edf40 --- .../gr-change-table-behavior.html | 14 +++++------ .../gr-change-table-behavior_test.html | 23 ++++++++++--------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/polygerrit-ui/app/behaviors/gr-change-table-behavior/gr-change-table-behavior.html b/polygerrit-ui/app/behaviors/gr-change-table-behavior/gr-change-table-behavior.html index ca955b36f8..178dd7c131 100644 --- a/polygerrit-ui/app/behaviors/gr-change-table-behavior/gr-change-table-behavior.html +++ b/polygerrit-ui/app/behaviors/gr-change-table-behavior/gr-change-table-behavior.html @@ -18,7 +18,7 @@ limitations under the License. 'use strict'; /** @polymerBehavior Gerrit.ChangeTableBehavior */ - var ChangeTableBehavior = { + const ChangeTableBehavior = { properties: { columnNames: { type: Array, @@ -32,21 +32,21 @@ limitations under the License. 'Size', ], readOnly: true, - } + }, }, /** * Returns the complement to the given column array * @param {Array} columns */ - getComplementColumns: function(columns) { - return this.columnNames.filter(function(column) { - return columns.indexOf(column) === -1; + getComplementColumns(columns) { + return this.columnNames.filter(column => { + return !columns.includes(column); }); }, - isColumnHidden: function(columnToCheck, columnsToDisplay) { - return columnsToDisplay.indexOf(columnToCheck) === -1; + isColumnHidden(columnToCheck, columnsToDisplay) { + return !columnsToDisplay.includes(columnToCheck); }, }; diff --git a/polygerrit-ui/app/behaviors/gr-change-table-behavior/gr-change-table-behavior_test.html b/polygerrit-ui/app/behaviors/gr-change-table-behavior/gr-change-table-behavior_test.html index 71d831dc07..adc9810377 100644 --- a/polygerrit-ui/app/behaviors/gr-change-table-behavior/gr-change-table-behavior_test.html +++ b/polygerrit-ui/app/behaviors/gr-change-table-behavior/gr-change-table-behavior_test.html @@ -39,11 +39,12 @@ limitations under the License.