diff options
author | Nathan-SR <144961007+Nathan-SR@users.noreply.github.com> | 2024-06-29 19:07:27 -0400 |
---|---|---|
committer | Nathan-SR <144961007+Nathan-SR@users.noreply.github.com> | 2024-06-29 19:07:27 -0400 |
commit | 6d8c85aacba7d9ccdedfb85b838e84ad914e6081 (patch) | |
tree | 9fcd8ea1c26e02c77e68c40189728274b2d252bc /src | |
parent | 25e69f18cf38587853771be8080035ab8a460e7e (diff) |
highlight updates properly when highlighted cell is selected; no longer possible to add EmptyKey to equation
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/collections/collectionSchema/CollectionSchemaView.tsx | 13 | ||||
-rw-r--r-- | src/client/views/collections/collectionSchema/SchemaTableCell.tsx | 2 |
2 files changed, 9 insertions, 6 deletions
diff --git a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx index d3259d42e..bcb94e10d 100644 --- a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx +++ b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx @@ -73,11 +73,8 @@ export class CollectionSchemaView extends CollectionSubView() { constructor(props: any) { super(props); makeObservable(this); - const lightenedColor = (r: number, g: number, b:number) => { - const lightened = ClientUtils.lightenRGB(r, g, b, 165); - return {r: lightened[0], g: lightened[1], b: lightened[2]} - } - const colors = (r: number, g: number, b: number): [any, any] => {return [{r: r, g: g, b: b}, lightenedColor(r, g, b)]} + const lightenedColor = (r: number, g: number, b:number) => { const lightened = ClientUtils.lightenRGB(r, g, b, 165); return {r: lightened[0], g: lightened[1], b: lightened[2]}} // prettier-ignore + const colors = (r: number, g: number, b: number): [any, any] => {return [{r: r, g: g, b: b}, lightenedColor(r, g, b)]} // prettier-ignore this._eqHighlightColors.push(colors(70, 150, 50)); this._eqHighlightColors.push(colors(180, 70, 20)); this._eqHighlightColors.push(colors(70, 50, 150)); @@ -602,7 +599,11 @@ export class CollectionSchemaView extends CollectionSubView() { } removeCellHighlights = () => { - this.highlightedCells.forEach(cell => {cell.style.border = ''; cell.style.backgroundColor = '';}); + this._highlightedCellsInfo.forEach(info => { + const doc = info[0]; + const cell = this.getCellElement(doc, info[1]); + if (!this._selectedDocs.includes(doc)) cell.style.border = ''; + cell.style.backgroundColor = '';}); this._highlightedCellsInfo = []; } diff --git a/src/client/views/collections/collectionSchema/SchemaTableCell.tsx b/src/client/views/collections/collectionSchema/SchemaTableCell.tsx index 084306c4a..1f5684151 100644 --- a/src/client/views/collections/collectionSchema/SchemaTableCell.tsx +++ b/src/client/views/collections/collectionSchema/SchemaTableCell.tsx @@ -266,6 +266,8 @@ export class SchemaTableCell extends ObservableReactComponent<SchemaTableCellPro className="schema-table-cell" onContextMenu={e => StopEvent(e)} onPointerDown={action(e => { + if (this.lockedInteraction) { e.stopPropagation(); e.preventDefault(); return; } + if (this._props.refSelectModeInfo.enabled && !selectedCell(this._props)){ e.stopPropagation(); e.preventDefault(); |