Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/addon/mod/lesson/pages/player/player.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
</ng-container>

<ion-item>
<button ion-button block (click)="submitQuestion($event)" class="button-no-uppercase">{{ question.submitLabel }}</button>
<button ion-button block text-wrap (click)="submitQuestion($event)" class="button-no-uppercase">{{ question.submitLabel }}</button>
</ion-item>
</form>
</ion-card>
Expand Down Expand Up @@ -175,7 +175,7 @@ <h3 padding *ngIf="eolData.gradelesson">{{ 'addon.mod_lesson.congratulations' |
<core-format-text [text]="eolData.displayofgrade.message"></core-format-text>
</ion-item>
<ion-item text-wrap *ngIf="eolData.reviewlesson">
<a ion-button block (click)="reviewLesson(eolData.reviewlesson.pageid)" class="button-no-uppercase">
<a ion-button block text-wrap (click)="reviewLesson(eolData.reviewlesson.pageid)" class="button-no-uppercase">
<core-format-text [text]="'addon.mod_lesson.reviewlesson' | translate"></core-format-text>
</a>
</ion-item>
Expand All @@ -185,7 +185,7 @@ <h3 padding *ngIf="eolData.gradelesson">{{ 'addon.mod_lesson.congratulations' |
<ion-item text-wrap *ngIf="eolData.activitylink && eolData.activitylink.value">
<ng-container *ngIf="eolData.activitylink.value.formatted">
<!-- Activity link was successfully formatted, render the button. -->
<a ion-button block color="light" [href]="eolData.activitylink.value.href" core-link [capture]="true" class="button-no-uppercase">
<a ion-button block text-wrap color="light" [href]="eolData.activitylink.value.href" core-link [capture]="true" class="button-no-uppercase">
<core-format-text [text]="eolData.activitylink.value.label"></core-format-text>
</a>
</ng-container>
Expand All @@ -212,8 +212,8 @@ <h3 padding *ngIf="eolData.gradelesson">{{ 'addon.mod_lesson.congratulations' |
</div>
</ion-item>
<ion-item text-wrap *ngIf="review || (processData.buttons && processData.buttons.length)">
<a ion-button block color="light" *ngIf="review" (click)="changePage(LESSON_EOL)">{{ 'addon.mod_lesson.finish' | translate }}</a>
<a ion-button block color="light" *ngFor="let button of processData.buttons" (click)="changePage(button.pageId, true)">{{ button.label | translate }}</a>
<a ion-button block text-wrap color="light" *ngIf="review" (click)="changePage(LESSON_EOL)">{{ 'addon.mod_lesson.finish' | translate }}</a>
<a ion-button block text-wrap color="light" *ngFor="let button of processData.buttons" (click)="changePage(button.pageId, true)">{{ button.label | translate }}</a>
</ion-item>
</ion-list>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/addon/mod/lesson/pages/user-retake/user-retake.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ <h2>{{page.qtype}}: {{page.title}}</h2>
<!-- Content page, display a button and the content. -->
<ion-row>
<ion-col>
<button ion-button block color="light" [disabled]="true">{{ answer[0].buttonText }}</button>
<button ion-button block text-wrap color="light" [disabled]="true">{{ answer[0].buttonText }}</button>
</ion-col>
<ion-col>
<p [innerHTML]="answer[0].content"></p>
Expand Down
51 changes: 50 additions & 1 deletion src/app/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ ion-app.app-root {
> ion-icon {
color: $color-base;
position: absolute;
@include position(0, null, null, 16px)
@include position(0, null, null, 16px);
height: 100%;
font-size: 24px;
display: flex;
Expand Down Expand Up @@ -1103,3 +1103,52 @@ ion-app.platform-desktop {
}
}
}

// Fix text wrapping in block buttons.
.button-block[text-wrap] {
height: auto;

// Changed from "strict" because the size depends on child elements.
contain: content;

// Add vertical padding, we cannot rely on a fixed height + centering like in normal buttons.
.item-md & {
padding-top: .5357em;
padding-bottom: .5357em;
}
.item-md &.item-button {
padding-top: .6em;
padding-bottom: .6em;
}
.item-ios & {
padding-top: .9em;
padding-bottom: .9em;
}
.item-ios &.item-button {
padding-top: .7846em;
padding-bottom: .7846em;
}

// Keep a consistent height with normal buttons if text does not wrap.
display: flex;
flex-flow: row;
align-items: center;
&.button-md {
min-height: $button-md-height;
}
&.button-large-md {
min-height: $button-md-large-height;
}
&.button-small-md {
min-height: $button-md-small-height;
}
&.button-ios {
min-height: $button-ios-height;
}
&.button-large-ios {
min-height: $button-ios-large-height;
}
&.button-small-ios {
min-height: $button-ios-small-height;
}
}
5 changes: 4 additions & 1 deletion src/components/rich-text-editor/rich-text-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@ export class CoreRichTextEditorComponent implements AfterContentInit, OnDestroy
// Editor is ready, adjust Height if needed.
let height;

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