Skip to content

Commit f719d8e

Browse files
authored
Merge pull request #1965 from albertgasset/MOBILE-3039
Mobile 3039
2 parents 67449aa + 35656ab commit f719d8e

File tree

4 files changed

+60
-8
lines changed

4 files changed

+60
-8
lines changed

src/addon/mod/lesson/pages/player/player.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
</ng-container>
109109

110110
<ion-item>
111-
<button ion-button block (click)="submitQuestion($event)" class="button-no-uppercase">{{ question.submitLabel }}</button>
111+
<button ion-button block text-wrap (click)="submitQuestion($event)" class="button-no-uppercase">{{ question.submitLabel }}</button>
112112
</ion-item>
113113
</form>
114114
</ion-card>
@@ -175,7 +175,7 @@ <h3 padding *ngIf="eolData.gradelesson">{{ 'addon.mod_lesson.congratulations' |
175175
<core-format-text [text]="eolData.displayofgrade.message"></core-format-text>
176176
</ion-item>
177177
<ion-item text-wrap *ngIf="eolData.reviewlesson">
178-
<a ion-button block (click)="reviewLesson(eolData.reviewlesson.pageid)" class="button-no-uppercase">
178+
<a ion-button block text-wrap (click)="reviewLesson(eolData.reviewlesson.pageid)" class="button-no-uppercase">
179179
<core-format-text [text]="'addon.mod_lesson.reviewlesson' | translate"></core-format-text>
180180
</a>
181181
</ion-item>
@@ -185,7 +185,7 @@ <h3 padding *ngIf="eolData.gradelesson">{{ 'addon.mod_lesson.congratulations' |
185185
<ion-item text-wrap *ngIf="eolData.activitylink && eolData.activitylink.value">
186186
<ng-container *ngIf="eolData.activitylink.value.formatted">
187187
<!-- Activity link was successfully formatted, render the button. -->
188-
<a ion-button block color="light" [href]="eolData.activitylink.value.href" core-link [capture]="true" class="button-no-uppercase">
188+
<a ion-button block text-wrap color="light" [href]="eolData.activitylink.value.href" core-link [capture]="true" class="button-no-uppercase">
189189
<core-format-text [text]="eolData.activitylink.value.label"></core-format-text>
190190
</a>
191191
</ng-container>
@@ -212,8 +212,8 @@ <h3 padding *ngIf="eolData.gradelesson">{{ 'addon.mod_lesson.congratulations' |
212212
</div>
213213
</ion-item>
214214
<ion-item text-wrap *ngIf="review || (processData.buttons && processData.buttons.length)">
215-
<a ion-button block color="light" *ngIf="review" (click)="changePage(LESSON_EOL)">{{ 'addon.mod_lesson.finish' | translate }}</a>
216-
<a ion-button block color="light" *ngFor="let button of processData.buttons" (click)="changePage(button.pageId, true)">{{ button.label | translate }}</a>
215+
<a ion-button block text-wrap color="light" *ngIf="review" (click)="changePage(LESSON_EOL)">{{ 'addon.mod_lesson.finish' | translate }}</a>
216+
<a ion-button block text-wrap color="light" *ngFor="let button of processData.buttons" (click)="changePage(button.pageId, true)">{{ button.label | translate }}</a>
217217
</ion-item>
218218
</ion-list>
219219
</div>

src/addon/mod/lesson/pages/user-retake/user-retake.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ <h2>{{page.qtype}}: {{page.title}}</h2>
7878
<!-- Content page, display a button and the content. -->
7979
<ion-row>
8080
<ion-col>
81-
<button ion-button block color="light" [disabled]="true">{{ answer[0].buttonText }}</button>
81+
<button ion-button block text-wrap color="light" [disabled]="true">{{ answer[0].buttonText }}</button>
8282
</ion-col>
8383
<ion-col>
8484
<p [innerHTML]="answer[0].content"></p>

src/app/app.scss

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ ion-app.app-root {
678678
> ion-icon {
679679
color: $color-base;
680680
position: absolute;
681-
@include position(0, null, null, 16px)
681+
@include position(0, null, null, 16px);
682682
height: 100%;
683683
font-size: 24px;
684684
display: flex;
@@ -1103,3 +1103,52 @@ ion-app.platform-desktop {
11031103
}
11041104
}
11051105
}
1106+
1107+
// Fix text wrapping in block buttons.
1108+
.button-block[text-wrap] {
1109+
height: auto;
1110+
1111+
// Changed from "strict" because the size depends on child elements.
1112+
contain: content;
1113+
1114+
// Add vertical padding, we cannot rely on a fixed height + centering like in normal buttons.
1115+
.item-md & {
1116+
padding-top: .5357em;
1117+
padding-bottom: .5357em;
1118+
}
1119+
.item-md &.item-button {
1120+
padding-top: .6em;
1121+
padding-bottom: .6em;
1122+
}
1123+
.item-ios & {
1124+
padding-top: .9em;
1125+
padding-bottom: .9em;
1126+
}
1127+
.item-ios &.item-button {
1128+
padding-top: .7846em;
1129+
padding-bottom: .7846em;
1130+
}
1131+
1132+
// Keep a consistent height with normal buttons if text does not wrap.
1133+
display: flex;
1134+
flex-flow: row;
1135+
align-items: center;
1136+
&.button-md {
1137+
min-height: $button-md-height;
1138+
}
1139+
&.button-large-md {
1140+
min-height: $button-md-large-height;
1141+
}
1142+
&.button-small-md {
1143+
min-height: $button-md-small-height;
1144+
}
1145+
&.button-ios {
1146+
min-height: $button-ios-height;
1147+
}
1148+
&.button-large-ios {
1149+
min-height: $button-ios-large-height;
1150+
}
1151+
&.button-small-ios {
1152+
min-height: $button-ios-small-height;
1153+
}
1154+
}

src/components/rich-text-editor/rich-text-editor.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,10 @@ export class CoreRichTextEditorComponent implements AfterContentInit, OnDestroy
148148
// Editor is ready, adjust Height if needed.
149149
let height;
150150

151-
if (this.platform.is('ios') && this.kbHeight > 0) {
151+
if (this.platform.is('android')) {
152+
// Android, ignore keyboard height because web view is resized.
153+
height = this.domUtils.getContentHeight(this.content) - this.getSurroundingHeight(this.element);
154+
} else if (this.platform.is('ios') && this.kbHeight > 0) {
152155
// Keyboard open in iOS.
153156
// In this case, the header disappears or is scrollable, so we need to adjust the calculations.
154157
height = window.innerHeight - this.getSurroundingHeight(this.element);

0 commit comments

Comments
 (0)