From 9935efe96689e8208630523424f1eba285b77db0 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 26 Jun 2020 17:40:00 +0200 Subject: [PATCH] fix(check-all): fix column collection --- frontend/src/lib/table/table.js | 2 +- frontend/src/utils/check-all/check-all.js | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/frontend/src/lib/table/table.js b/frontend/src/lib/table/table.js index 8178c0b74..a87ef02c8 100644 --- a/frontend/src/lib/table/table.js +++ b/frontend/src/lib/table/table.js @@ -1,4 +1,4 @@ -const DEBUG_MODE = /localhost/.test(window.location.href) ? 1 : 0; +const DEBUG_MODE = /localhost/.test(window.location.href) ? 0 : 0; import * as defer from 'lodash.defer'; diff --git a/frontend/src/utils/check-all/check-all.js b/frontend/src/utils/check-all/check-all.js index 05a9bd98d..b9796eeb5 100644 --- a/frontend/src/utils/check-all/check-all.js +++ b/frontend/src/utils/check-all/check-all.js @@ -1,3 +1,5 @@ +const DEBUG_MODE = /localhost/.test(window.location.href) ? 0 : 0; + import { Utility } from '../../core/utility'; import { TableIndices } from '../../lib/table/table'; @@ -30,6 +32,10 @@ export class CheckAll { this._tableIndices = new TableIndices(this._element); this._gatherColumns(); + + if (DEBUG_MODE > 0) + console.log(this._columns); + this._findCheckboxColumns().forEach(columnId => this._checkAllColumns.push(new CheckAllColumn(this._element, app, this._columns[columnId]))); // mark initialized @@ -37,8 +43,11 @@ export class CheckAll { } _gatherColumns() { - for (const rowIndex of new Array(this._tableIndices.maxRow + 1)) { - for (const colIndex of new Array(this._tableIndices.maxCol + 1)) { + for (const rowIndex of Array(this._tableIndices.maxRow + 1).keys()) { + for (const colIndex of Array(this._tableIndices.maxCol + 1).keys()) { + if (DEBUG_MODE > 1) + console.log(rowIndex, colIndex); + const cell = this._tableIndices.getCell(rowIndex, colIndex); if (!cell)