MOBILE-4176 grades: Apply bold styles

main
Noel De Martin 2022-11-21 16:18:56 +01:00
parent a62cb0ca1e
commit 222704a59b
2 changed files with 13 additions and 5 deletions

View File

@ -64,6 +64,10 @@
font-weight: normal; font-weight: normal;
} }
tbody tr.core-bold th {
font-weight: inherit;
}
tbody #gradeitem { tbody #gradeitem {
@include padding(null, null, null, 4px); @include padding(null, null, null, 4px);
} }

View File

@ -110,7 +110,7 @@ export class CoreGradesHelperProvider {
rowspan: tableRow.leader?.rowspan, rowspan: tableRow.leader?.rowspan,
}; };
this.setRowEvenOddClass(row, (tableRow.leader as CoreGradesTableLeaderColumn).class); this.setRowStyleClasses(row, (tableRow.leader as CoreGradesTableLeaderColumn).class);
return row; return row;
} }
@ -132,7 +132,7 @@ export class CoreGradesHelperProvider {
row.rowspan = tableRow.leader?.rowspan || 1; row.rowspan = tableRow.leader?.rowspan || 1;
this.setRowIconAndType(row, content); this.setRowIconAndType(row, content);
this.setRowEvenOddClass(row, itemNameColumn.class); this.setRowStyleClasses(row, itemNameColumn.class);
row.rowclass += itemNameColumn.class.indexOf('hidden') >= 0 ? ' hidden' : ''; row.rowclass += itemNameColumn.class.indexOf('hidden') >= 0 ? ' hidden' : '';
row.rowclass += itemNameColumn.class.indexOf('dimmed_text') >= 0 ? ' dimmed_text' : ''; row.rowclass += itemNameColumn.class.indexOf('dimmed_text') >= 0 ? ' dimmed_text' : '';
@ -625,15 +625,19 @@ export class CoreGradesHelperProvider {
} }
/** /**
* Set 'odd' or 'even' classes into a row. * Set row style classes.
* *
* @param row Row. * @param row Row.
* @param classes Existing row classes. * @param classes Unformatted classes.
*/ */
protected setRowEvenOddClass(row: CoreGradesFormattedTableRow, classes: string): void { protected setRowStyleClasses(row: CoreGradesFormattedTableRow, classes: string): void {
const level = parseInt(classes.match(/(?:^|\s)level(\d+)(?:$|\s)/)?.[1] ?? '0'); const level = parseInt(classes.match(/(?:^|\s)level(\d+)(?:$|\s)/)?.[1] ?? '0');
row.rowclass = `${row.rowclass ?? ''} ${level % 2 === 0 ? 'even' : 'odd'}`.trim(); row.rowclass = `${row.rowclass ?? ''} ${level % 2 === 0 ? 'even' : 'odd'}`.trim();
if (classes.match(/(^|\s)(category|bagg(b|t))($|\s)/)) {
row.rowclass += ' core-bold';
}
} }
/** /**