MOBILE-2540 lesson: Fix more than one choice in single choice questions

main
Dani Palou 2018-08-01 14:54:46 +02:00
parent e6c5607463
commit cf79beba80
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

@ -536,10 +536,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);
}
});
}
}