Merge pull request #1446 from dpalou/MOBILE-2540

MOBILE-2540 lesson: Fix more than one choice in single choice questions
main
Juan Leyva 2018-08-21 15:48:07 +01:00 committed by GitHub
commit c10b49b270
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 5 deletions

View File

@ -37,7 +37,8 @@
</ion-item>
<!-- Question page. -->
<form *ngIf="question" ion-list [formGroup]="questionForm">
<!-- We need to set ngIf loaded to make formGroup directive restart every time a page changes, see MOBILE-2540. -->
<form *ngIf="question && loaded" ion-list [formGroup]="questionForm">
<ion-item-divider text-wrap color="light">
<core-format-text [component]="component" [componentId]="lesson.coursemodule" [text]="pageContent"></core-format-text>
</ion-item-divider>

View File

@ -547,10 +547,12 @@ export class CoreFormatTextDirective implements OnChanges {
// Do the iframe responsive.
if (iframe.parentElement.classList.contains('embed-responsive')) {
iframe.addEventListener('load', () => {
const css = document.createElement('style');
css.setAttribute('type', 'text/css');
css.innerHTML = 'iframe {width: 100%;height: 100%;}';
iframe.contentDocument.head.appendChild(css);
if (iframe.contentDocument) {
const css = document.createElement('style');
css.setAttribute('type', 'text/css');
css.innerHTML = 'iframe {width: 100%;height: 100%;}';
iframe.contentDocument.head.appendChild(css);
}
});
}
}