From c28dca7b76f60c9c34da845ef1322ae0e839d79f Mon Sep 17 00:00:00 2001 From: Johannes Eder Date: Tue, 21 Sep 2021 17:15:32 +0200 Subject: [PATCH] chore(check-all): removed checkrange from checkall --- frontend/src/utils/check-all/check-all.js | 28 ----------------------- 1 file changed, 28 deletions(-) diff --git a/frontend/src/utils/check-all/check-all.js b/frontend/src/utils/check-all/check-all.js index e1bef2b09..94115ffee 100644 --- a/frontend/src/utils/check-all/check-all.js +++ b/frontend/src/utils/check-all/check-all.js @@ -37,44 +37,16 @@ export class CheckAll { if (DEBUG_MODE > 0) console.log(this._columns); - - //Todo: 1 forEach loop let checkboxColumns = this._findCheckboxColumns(); checkboxColumns.forEach(columnId => this._checkAllColumns.push(new CheckAllColumn(this._element, app, this._columns[columnId]))); - checkboxColumns.forEach(columnId => { - let currentColumn = this._columns[columnId]; - currentColumn.forEach(el => el.addEventListener('click', (ev) => { - - if(ev.shiftKey && this.lastCheckedCell !== null) { - let lastClickedIndex = this._tableIndices.rowIndex(this._lastCheckedCell); - let currentCellIndex = this._tableIndices.rowIndex(el); - if(currentCellIndex > lastClickedIndex) - this._checkMultipleCells(lastClickedIndex, currentCellIndex, columnId); - else - this._checkMultipleCells(currentCellIndex, lastClickedIndex, columnId); - } else { - this._lastCheckedCell = el; - } - })); - - }); // mark initialized this._element.classList.add(CHECK_ALL_INITIALIZED_CLASS); } - _checkMultipleCells(firstRowIndex, lastRowIndex, columnId) { - for(let i=firstRowIndex; i<=lastRowIndex; i++) { - let cell = this._columns[columnId][i]; - if (cell.tagName !== 'TH') { - cell.querySelector(CHECKBOX_SELECTOR).checked = true; - } - } - } - _gatherColumns() { for (const rowIndex of Array(this._tableIndices.maxRow + 1).keys()) { for (const colIndex of Array(this._tableIndices.maxCol + 1).keys()) {