Skip to content

Commit

Permalink
Highlight table row for currently selected version
Browse files Browse the repository at this point in the history
  • Loading branch information
norrisng-bc committed Aug 2, 2023
1 parent 1fd984d commit 6c4641c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions frontend/src/assets/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ a:visited {
}
}
}
// highlight the row for the currently selected version
.details-selected-version {
background-color: $bcbox-highlight-background !important;
}
.details-value-column {
width: 40rem;
}
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/components/object/ObjectVersion.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ const tableData: Ref<Array<VersionDataSource>> = ref([]);
const router = useRouter();
const toast = useToast();
// Highlight row for currently selected version
const rowClass = (data: any) => {
return [{ 'details-selected-version': data.id === props.versionId}];
};
async function onDeletedSuccess(versionId: string) {
toast.success('File deleted');
await versionStore.fetchVersions({ objectId: props.objectId });
Expand Down Expand Up @@ -97,6 +102,7 @@ watch( getVersions, () => {
responsive-layout="scroll"
:paginator="true"
:rows="5"
:row-class="rowClass"
paginator-template="RowsPerPageDropdown CurrentPageReport PrevPageLink NextPageLink "
current-page-report-template="{first}-{last} of {totalRecords}"
:rows-per-page-options="[5, 10, 20]"
Expand Down

0 comments on commit 6c4641c

Please sign in to comment.