forked from EVOgeek/Vmeda.Online
		
	MOBILE-3413 h5p: Fix h5p iframe not visible in offline
This commit is contained in:
		
							parent
							
								
									bea4e501b4
								
							
						
					
					
						commit
						3297ec0c87
					
				| @ -75,17 +75,17 @@ export class CoreIframeComponent implements OnInit, OnChanges { | ||||
|         const navCtrl = this.svComponent ? this.svComponent.getMasterNav() : this.navCtrl; | ||||
|         this.iframeUtils.treatFrame(iframe, false, navCtrl); | ||||
| 
 | ||||
|         iframe.addEventListener('load', () => { | ||||
|             this.loading = false; | ||||
|             this.loaded.emit(iframe); // Notify iframe was loaded.
 | ||||
|         }); | ||||
| 
 | ||||
|         iframe.addEventListener('error', () => { | ||||
|             this.loading = false; | ||||
|             this.domUtils.showErrorModal('core.errorloadingcontent', true); | ||||
|         }); | ||||
| 
 | ||||
|         if (this.loading) { | ||||
|             iframe.addEventListener('load', () => { | ||||
|                 this.loading = false; | ||||
|                 this.loaded.emit(iframe); // Notify iframe was loaded.
 | ||||
|             }); | ||||
| 
 | ||||
|             iframe.addEventListener('error', () => { | ||||
|                 this.loading = false; | ||||
|                 this.domUtils.showErrorModal('core.errorloadingcontent', true); | ||||
|             }); | ||||
| 
 | ||||
|             setTimeout(() => { | ||||
|                 this.loading = false; | ||||
|             }, this.IFRAME_TIMEOUT); | ||||
|  | ||||
| @ -55,7 +55,7 @@ export class CoreIframeUtilsProvider { | ||||
|     checkOnlineFrameInOffline(element: any, isSubframe?: boolean): boolean { | ||||
|         const src = element.src || element.data; | ||||
| 
 | ||||
|         if (src && !this.urlUtils.isLocalFileUrl(src) && !this.appProvider.isOnline()) { | ||||
|         if (src && src != 'about:blank' && !this.urlUtils.isLocalFileUrl(src) && !this.appProvider.isOnline()) { | ||||
|             if (element.classList.contains('core-iframe-offline-disabled')) { | ||||
|                 // Iframe already hidden, stop.
 | ||||
|                 return true; | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user