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,7 +75,6 @@ export class CoreIframeComponent implements OnInit, OnChanges { | |||||||
|         const navCtrl = this.svComponent ? this.svComponent.getMasterNav() : this.navCtrl; |         const navCtrl = this.svComponent ? this.svComponent.getMasterNav() : this.navCtrl; | ||||||
|         this.iframeUtils.treatFrame(iframe, false, navCtrl); |         this.iframeUtils.treatFrame(iframe, false, navCtrl); | ||||||
| 
 | 
 | ||||||
|         if (this.loading) { |  | ||||||
|         iframe.addEventListener('load', () => { |         iframe.addEventListener('load', () => { | ||||||
|             this.loading = false; |             this.loading = false; | ||||||
|             this.loaded.emit(iframe); // Notify iframe was loaded.
 |             this.loaded.emit(iframe); // Notify iframe was loaded.
 | ||||||
| @ -86,6 +85,7 @@ export class CoreIframeComponent implements OnInit, OnChanges { | |||||||
|             this.domUtils.showErrorModal('core.errorloadingcontent', true); |             this.domUtils.showErrorModal('core.errorloadingcontent', true); | ||||||
|         }); |         }); | ||||||
| 
 | 
 | ||||||
|  |         if (this.loading) { | ||||||
|             setTimeout(() => { |             setTimeout(() => { | ||||||
|                 this.loading = false; |                 this.loading = false; | ||||||
|             }, this.IFRAME_TIMEOUT); |             }, this.IFRAME_TIMEOUT); | ||||||
|  | |||||||
| @ -55,7 +55,7 @@ export class CoreIframeUtilsProvider { | |||||||
|     checkOnlineFrameInOffline(element: any, isSubframe?: boolean): boolean { |     checkOnlineFrameInOffline(element: any, isSubframe?: boolean): boolean { | ||||||
|         const src = element.src || element.data; |         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')) { |             if (element.classList.contains('core-iframe-offline-disabled')) { | ||||||
|                 // Iframe already hidden, stop.
 |                 // Iframe already hidden, stop.
 | ||||||
|                 return true; |                 return true; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user