(core) Inactive card list widget now have idicator that show cursor position of linked widget

Test Plan: nbrowser test added

Reviewers: georgegevoian

Reviewed By: georgegevoian

Differential Revision: https://phab.getgrist.com/D4009
This commit is contained in:
Jakub Serafin
2023-08-24 13:04:15 +02:00
parent d5a4605d2a
commit 2073e6224e
3 changed files with 37 additions and 2 deletions

View File

@@ -121,7 +121,13 @@
.detailview_record_detail.active {
/* highlight active record in Card List by overlaying the active-section highlight */
margin-left: -3px;
border-left: 3px solid var(--grist-color-light-green);
border-left: 3px solid var(--grist-theme-cursor, var(--grist-color-light-green));
}
.detailview_record_detail.selected {
/* highlight selected record in Card List by overlaying the inactive-cursor highlight */
margin-left: -3px;
border-left: 3px solid var(--grist-theme-cursor-inactive, var(--grist-color-inactive-cursor));
}
}

View File

@@ -430,6 +430,7 @@ DetailView.prototype.makeRecord = function(record) {
return rowType && `diff-${rowType}` || '';
}) : null,
kd.toggleClass('active', () => (this.cursor.rowIndex() === record._index() && this.viewSection.hasFocus())),
kd.toggleClass('selected', () => (this.cursor.rowIndex() === record._index() && !this.viewSection.hasFocus())),
// 'detailview_record_single' or 'detailview_record_detail' doesn't need to be an observable,
// since a change to parentKey would cause a separate call to makeRecord.
kd.cssClass('detailview_record_' + this.viewSection.parentKey.peek())