diff options
-rw-r--r-- | src/client/views/collections/collectionSchema/CollectionSchemaView.tsx | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx index 4e4a618bf..d844fdefc 100644 --- a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx +++ b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx @@ -548,8 +548,6 @@ export class CollectionSchemaView extends CollectionSubView() { @action selectCell = (doc: Doc, col: number, shiftKey: boolean, ctrlKey: boolean) => { - this.populateCellTags(); - //docs.findIndex(doc); if (!shiftKey && !ctrlKey) this.clearSelection(); !this._selectedCells && (this._selectedCells = []); !shiftKey && this._selectedCells && this._selectedCells.push(doc); @@ -566,10 +564,7 @@ export class CollectionSchemaView extends CollectionSubView() { } else this.addDocToSelection(doc, false); this._selectedCol = col; - if (this._lowestSelectedIndex === -1 || index < this._lowestSelectedIndex) this._lowestSelectedIndex = index; - - // let selectedIndexes: Array<Number> = this._selectedCells.map(doc => this.rowIndex(doc)); }; @action @@ -586,71 +581,6 @@ export class CollectionSchemaView extends CollectionSubView() { sortedSelectedDocs = () => this.sortedDocs.docs.filter(doc => this._selectedDocs.includes(doc)); - - getCellTag = (doc: Doc, col: number) => { - return this._cellTags.get(doc)[col]; - } - - getCellInfoFromTag = (tag: string): [Doc, string] => { - const lettersToNumber = (letters: string) => { - let number = 0; - let length = letters.length; - for (let i = 0; i < length; i++) { - number *= 26; - number += (letters.charCodeAt(i) - 'A'.charCodeAt(0) + 1); - } - return number; - } - - const colTag = tag.replace(/[^A-Z]/g, ''); - const col = lettersToNumber(colTag); - const key: string = this.columnKeys[col - 1]; - - const rowNum = Number(tag.replace(/[^\d]/g, '')); - const doc = this.childDocs[rowNum - 1]; - - return [doc, key]; - } - - populateCellTags = () => { - this.childDocs.forEach(doc => this.addTags(doc)); - } - - addTags = (doc: Doc) => { - const row = this.rowIndex(doc) + 1; - const tags = []; - for (let col = 1; col <= this._colEles.length; ++col){ - tags.push(this.numToChar(col) + row.toString()) - } - this._cellTags.set(doc, tags) - } - - modifyCellTags = (addingColumn: boolean) => { - if (addingColumn) { - const colTag = this.numToChar(this._colEles.length); - this._cellTags.forEach((tags, row) => { - const newTag = colTag + this.rowIndex(row); - tags.push(newTag); - }); - } else { - this._cellTags.forEach(tags => { - if (tags.length > 0) { - tags.pop(); - } - }) - } - } - - numToChar = (num: number) => { - let result = ''; - while (num > 0) { - let remainder = (num - 1) % 26; - result = String.fromCharCode(65 + remainder) + result; - num = Math.floor((num - 1) / 26); - } - return result; - } - @computed get rowDropIndex() { const mouseY = this.ScreenToLocalBoxXf().transformPoint(this._mouseCoordinates.x, this._mouseCoordinates.y)[1]; |