Skip to content

Commit dab503b

Browse files
authored
Merge pull request #3541 from crazyserver/MOBILE-4065
Mobile 4065
2 parents c137025 + a2788e2 commit dab503b

File tree

26 files changed

+230
-161
lines changed

26 files changed

+230
-161
lines changed

package-lock.json

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"@ionic-native/status-bar": "5.36.0",
7474
"@ionic-native/web-intent": "5.36.0",
7575
"@ionic-native/zip": "5.36.0",
76-
"@ionic/angular": "5.9.2",
76+
"@ionic/angular": "5.9.4",
7777
"@moodlehq/cordova-plugin-file-opener": "3.0.5-moodle.1",
7878
"@moodlehq/cordova-plugin-file-transfer": "1.7.1-moodle.5",
7979
"@moodlehq/cordova-plugin-inappbrowser": "5.0.0-moodle.3",

src/addons/calendar/components/calendar/addon-calendar-calendar.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ <h2 id="addon-calendar-monthname">
3333
</ion-grid>
3434

3535
<core-swipe-slides [manager]="manager">
36-
<ng-template let-month="item">
36+
<ng-template let-month="item" let-activeView="active">
3737
<!-- Calendar view. -->
3838
<ion-grid class="addon-calendar-months" role="table" aria-describedby="addon-calendar-monthname">
3939
<div role="rowgroup">
@@ -57,9 +57,9 @@ <h2 id="addon-calendar-monthname">
5757
"today": month.isCurrentMonth && day.istoday,
5858
"weekend": day.isweekend,
5959
"duration_finish": day.haslastdayofevent
60-
}' [class.addon-calendar-event-past-day]="month.isPastMonth || day.ispast" role="cell" tabindex="0"
61-
(ariaButtonClick)="dayClicked(day.mday)">
62-
<p class="addon-calendar-day-number" role="button">
60+
}' [class.addon-calendar-event-past-day]="month.isPastMonth || day.ispast" role="cell"
61+
(ariaButtonClick)="dayClicked(day.mday)" [tabindex]="activeView ? 0 : -1">
62+
<p class="addon-calendar-day-number">
6363
<span aria-hidden="true">{{ day.mday }}</span>
6464
<span class="sr-only">{{ day.periodName | translate }}</span>
6565
</p>
@@ -72,8 +72,8 @@ <h2 id="addon-calendar-monthname">
7272
<div class="ion-hide-md-down addon-calendar-day-events" *ngIf="day.filteredEvents">
7373
<ng-container *ngFor="let event of day.filteredEvents | slice:0:4; let index = index">
7474
<div *ngIf="index < 3 || day.filteredEvents.length == 4" class="addon-calendar-event"
75-
[class.addon-calendar-event-past]="event.ispast" role="button" tabindex="0"
76-
(ariaButtonClick)="eventClicked(event, $event)">
75+
[class.addon-calendar-event-past]="event.ispast" (ariaButtonClick)="eventClicked(event, $event)"
76+
[tabindex]="activeView ? 0 : -1">
7777
<span class="calendar_event_type calendar_event_{{event.formattedType}}"></span>
7878
<ion-icon *ngIf="event.offline && !event.deleted" name="fas-clock"
7979
[attr.aria-label]="'core.notsent' | translate"></ion-icon>

src/addons/calendar/components/calendar/calendar.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
@include border-end(1px, solid var(--addon-calendar-border-color));
2626
overflow: hidden;
2727
min-height: 60px;
28-
cursor: pointer;
2928

3029
&:first-child {
3130
@include padding-horizontal(10px, null);

src/addons/mod/forum/components/index/index.html

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -74,26 +74,20 @@
7474
[lines]="discussion.groupname && 'none'" [attr.aria-current]="discussions?.getItemAriaCurrent(discussion)"
7575
(click)="discussions?.select(discussion)" button>
7676
<ion-label>
77-
<div class="addon-mod-forum-discussion-title">
78-
<p class="ion-text-wrap item-heading">
79-
<ion-icon name="fas-map-pin" *ngIf="discussion.pinned"
80-
[attr.aria-label]="'addon.mod_forum.discussionpinned' | translate"></ion-icon>
81-
<ion-icon name="fas-star" class="addon-forum-star" *ngIf="!discussion.pinned && discussion.starred"
82-
[attr.aria-label]="'addon.mod_forum.favourites' | translate"></ion-icon>
83-
<core-format-text [text]="discussion.subject" contextLevel="module" [contextInstanceId]="module && module.id"
84-
[courseId]="courseId">
85-
</core-format-text>
86-
<ion-icon name="fas-lock" *ngIf="discussion.locked" class="addon-mod-forum-locked-icon"
87-
[attr.aria-label]="'addon.mod_forum.discussionlocked' | translate"></ion-icon>
88-
</p>
89-
<ion-button *ngIf="canPin || discussion.canlock || discussion.canfavourite" fill="clear"
90-
[attr.aria-label]="('core.displayoptions' | translate)" (click)="showOptionsMenu($event, discussion)">
91-
<ion-icon name="ellipsis-vertical" slot="icon-only" aria-hidden="true">
92-
</ion-icon>
93-
</ion-button>
94-
</div>
77+
<p class="addon-mod-forum-discussion-title ion-text-wrap item-heading">
78+
<ion-icon name="fas-map-pin" *ngIf="discussion.pinned"
79+
[attr.aria-label]="'addon.mod_forum.discussionpinned' | translate"></ion-icon>
80+
<ion-icon name="fas-star" class="addon-forum-star" *ngIf="!discussion.pinned && discussion.starred"
81+
[attr.aria-label]="'addon.mod_forum.favourites' | translate"></ion-icon>
82+
<core-format-text [text]="discussion.subject" contextLevel="module" [contextInstanceId]="module && module.id"
83+
[courseId]="courseId">
84+
</core-format-text>
85+
<ion-icon name="fas-lock" *ngIf="discussion.locked" class="addon-mod-forum-locked-icon"
86+
[attr.aria-label]="'addon.mod_forum.discussionlocked' | translate"></ion-icon>
87+
</p>
9588
<div class="addon-mod-forum-discussion-info">
96-
<core-user-avatar *ngIf="discussion.userfullname" [user]="discussion" slot="start" [courseId]="courseId">
89+
<core-user-avatar *ngIf="discussion.userfullname" [user]="discussion" slot="start" [courseId]="courseId"
90+
[linkProfile]="false">
9791
</core-user-avatar>
9892
<div class="addon-mod-forum-discussion-author">
9993
<span *ngIf="discussion.userfullname">{{discussion.userfullname}}</span>
@@ -136,6 +130,11 @@
136130
</ion-col>
137131
</ion-row>
138132
</ion-label>
133+
<ion-button *ngIf="canPin || discussion.canlock || discussion.canfavourite" fill="clear"
134+
[attr.aria-label]="('core.displayoptions' | translate)" (click)="showOptionsMenu($event, discussion)" slot="end">
135+
<ion-icon name="ellipsis-vertical" slot="icon-only" aria-hidden="true">
136+
</ion-icon>
137+
</ion-button>
139138
</ion-item>
140139

141140
<core-infinite-loading [enabled]="discussions && discussions.loaded && !discussions.completed" [error]="fetchFailed"

src/addons/mod/forum/components/index/index.scss

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
}
88

99
.addon-mod-forum-discussion.item {
10-
1110
ion-label {
1211
margin-top: 4px;
1312

@@ -35,21 +34,30 @@
3534
@include margin(0, 8px, 0, 0);
3635
}
3736

38-
.addon-mod-forum-discussion-title,
3937
.addon-mod-forum-discussion-info {
4038
display: flex;
4139
align-items: center;
4240
}
4341

44-
.addon-mod-forum-discussion-title .item-heading,
4542
.addon-mod-forum-discussion-info .addon-mod-forum-discussion-author {
4643
flex-grow: 1;
4744
}
4845

46+
.addon-mod-forum-discussion-title {
47+
@include margin-horizontal(null, 8px);
48+
line-height: 18px;
49+
}
50+
51+
4952
.addon-mod-forum-discussion-more-info.ios {
5053
font-size: 0.9rem;
5154
}
5255

56+
ion-button {
57+
position: absolute;
58+
@include position (4px, 8px, null, null);
59+
}
60+
5361
}
5462

5563
.core-group-selector {

src/core/classes/aria-role-tab.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,19 @@ export class CoreAriaRoleTab<T = unknown> {
2929
* @param e Event.
3030
*/
3131
keyDown(tabFindIndex: string, e: KeyboardEvent): void {
32-
if (e.key == ' ' ||
33-
e.key == 'Enter' ||
34-
e.key == 'Home' ||
35-
e.key == 'End' ||
36-
(this.isHorizontal() && (e.key == 'ArrowRight' || e.key == 'ArrowLeft')) ||
37-
(!this.isHorizontal() && (e.key == 'ArrowUp' ||e.key == 'ArrowDown'))
32+
if (e.key === ' ' ||
33+
e.key === 'Enter' ||
34+
e.key === 'Home' ||
35+
e.key === 'End' ||
36+
(this.isHorizontal() && (e.key === 'ArrowRight' || e.key === 'ArrowLeft')) ||
37+
(!this.isHorizontal() && (e.key === 'ArrowUp' ||e.key === 'ArrowDown'))
3838
) {
3939
e.preventDefault();
4040
e.stopPropagation();
4141
e.stopImmediatePropagation();
4242
}
4343

44-
if (e.key == ' ' || e.key == 'Enter') {
44+
if (e.key === ' ' || e.key === 'Enter') {
4545
this.selectTabCandidate = tabFindIndex;
4646
}
4747
}
@@ -64,7 +64,7 @@ export class CoreAriaRoleTab<T = unknown> {
6464
e.stopPropagation();
6565
e.stopImmediatePropagation();
6666

67-
if (e.key == ' ' || e.key == 'Enter') {
67+
if (e.key === ' ' || e.key === 'Enter') {
6868
if (this.selectTabCandidate === tabFindIndex) {
6969
this.selectTab(tabFindIndex, e);
7070
}

src/core/components/show-password/show-password.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export class CoreShowPasswordComponent implements OnInit, AfterViewInit {
132132
* @param event The mouse event.
133133
*/
134134
doNotBlur(event: Event): void {
135-
if (event.type == 'keydown' && !this.isValidKeyboardKey(<KeyboardEvent>event)) {
135+
if (event.type === 'keydown' && !this.isValidKeyboardKey(<KeyboardEvent>event)) {
136136
return;
137137
}
138138

@@ -147,7 +147,7 @@ export class CoreShowPasswordComponent implements OnInit, AfterViewInit {
147147
* @returns Wether space or enter have been pressed.
148148
*/
149149
protected isValidKeyboardKey(event: KeyboardEvent): boolean {
150-
return event.key == ' ' || event.key == 'Enter';
150+
return event.key === ' ' || event.key === 'Enter';
151151
}
152152

153153
}

src/core/components/swipe-slides/swipe-slides.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<ion-slides *ngIf="loaded" (ionSlideWillChange)="slideWillChange()" (ionSlideDidChange)="slideDidChange()" [options]="options">
2-
<ion-slide *ngFor="let item of items; index as index">
2+
<ion-slide *ngFor="let item of items; index as index" [attr.aria-hidden]="!isActive(index)">
33
<ng-container *ngIf="template" [ngTemplateOutlet]="template" [ngTemplateOutletContext]="{item: item, active: isActive(index)}">
44
</ng-container>
55
</ion-slide>

src/core/components/user-avatar/core-user-avatar.html

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
<img *ngIf="avatarUrl" [src]="avatarUrl" [alt]="'core.pictureof' | translate:{$a: fullname}" core-external-content
2-
onError="this.src='assets/img/user-avatar.png'" (ariaButtonClick)="gotoProfile($event)" [attr.aria-hidden]="!linkProfile"
3-
[attr.role]="linkProfile ? 'button' : null" [attr.tabindex]="linkProfile ? 0 : null" [class.clickable]="linkProfile">
1+
<img *ngIf="avatarUrl && linkProfile" [src]="avatarUrl" [alt]="'core.pictureof' | translate:{$a: fullname}" core-external-content
2+
onError="this.src='assets/img/user-avatar.png'" (ariaButtonClick)="gotoProfile($event)">
43

5-
<img *ngIf="!avatarUrl" src="assets/img/user-avatar.png" [alt]="'core.pictureof' | translate:{$a: fullname}"
6-
(ariaButtonClick)="gotoProfile($event)" [attr.aria-hidden]="!linkProfile" [attr.role]="linkProfile ? 'button' : null"
7-
[attr.tabindex]="linkProfile ? 0 : null">
4+
<img *ngIf="avatarUrl && !linkProfile" [src]="avatarUrl" [alt]="'core.pictureof' | translate:{$a: fullname}" core-external-content
5+
onError="this.src='assets/img/user-avatar.png'" aria-hidden="true">
6+
7+
<img *ngIf="!avatarUrl && linkProfile" src="assets/img/user-avatar.png" [alt]="'core.pictureof' | translate:{$a: fullname}"
8+
(ariaButtonClick)="gotoProfile($event)">
9+
10+
<img *ngIf="!avatarUrl && !linkProfile" src="assets/img/user-avatar.png" [alt]="'core.pictureof' | translate:{$a: fullname}"
11+
aria-hidden="true">
812

913
<span *ngIf="checkOnline && isOnline()" class="contact-status online" role="status" [attr.aria-label]="'core.online' | translate">
1014
</span>

0 commit comments

Comments
 (0)