Skip to content

Commit 453c5cf

Browse files
committed
Fix(courses): correct checkbox display on different screen sizes
This commit fixes the display of checkboxes in the courses component. It ensures that only one checkbox is displayed per course on larger screens, and that the checkbox is displayed on smaller screens.
1 parent ea6a8ec commit 453c5cf

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

src/app/courses/courses.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
<mat-header-cell *matHeaderCellDef mat-sort-header="courseTitle" i18n> Title </mat-header-cell>
124124
<mat-cell *matCellDef="let element" class="list-content-menu" [ngClass]="{'list-content-menu-auto': element.doc.courseTitle.length > 50 }">
125125
<h3 class="header">
126-
<mat-checkbox (change)="$event ? selection.toggle(element._id) : null"
126+
<mat-checkbox class="mobile-checkbox" (change)="$event ? selection.toggle(element._id) : null"
127127
[checked]="selection.isSelected(element._id)">
128128
</mat-checkbox>
129129
<span class="margin-lr-5"></span>

src/app/courses/courses.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,15 @@ $label-height: 1rem;
6767
display: inline-block;
6868
}
6969

70+
.mat-cell .mobile-checkbox {
71+
display: none;
72+
}
73+
7074
@media(max-width: $screen-sm) {
75+
.mat-cell .mobile-checkbox {
76+
display: inline-block;
77+
}
78+
7179
.created-label {
7280
display: inline-block;
7381
}

src/app/resources/resources.component.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,11 @@ export class ResourcesComponent implements OnInit, AfterViewInit, OnDestroy {
133133
}
134134

135135
ngOnInit() {
136+
if (this.myView !== 'myPersonals') {
137+
this.displayedColumns = [ 'select', 'title', 'info', 'createdDate', 'rating' ];
138+
} else {
139+
this.displayedColumns = [ 'title', 'createdDate' ];
140+
}
136141
this.titleSearch = '';
137142
combineLatest(this.resourcesService.resourcesListener(this.parent), this.userService.shelfChange$).pipe(
138143
startWith([ [], null ]), skip(1), takeUntil(this.onDestroy$),

0 commit comments

Comments
 (0)