commit
						80b7b2a285
					
				| @ -187,7 +187,11 @@ | ||||
|             context: 'iframe', | ||||
|             action: 'link_clicked', | ||||
|             frameUrl: location.href, | ||||
|             link: {href: link.href, target: link.target}, | ||||
|             link: { | ||||
|                 href: link.href, | ||||
|                 target: link.target, | ||||
|                 originalHref: link.getAttribute('href'), | ||||
|             }, | ||||
|         }, '*'); | ||||
|     } | ||||
| 
 | ||||
| @ -207,4 +211,4 @@ | ||||
| 
 | ||||
|         return concatenatePaths(pathToDir, url); | ||||
|     } | ||||
| })(); | ||||
| })(); | ||||
|  | ||||
| @ -13,12 +13,11 @@ | ||||
| // limitations under the License.
 | ||||
| 
 | ||||
| import { Injectable } from '@angular/core'; | ||||
| import { CoreBlockDelegate } from '@features/block/services/block-delegate'; | ||||
| import { CoreMainMenuHomeHandler, CoreMainMenuHomeHandlerToDisplay } from '@features/mainmenu/services/home-delegate'; | ||||
| import { CoreSiteHome } from '@features/sitehome/services/sitehome'; | ||||
| import { CoreSiteHomeHomeHandler } from '@features/sitehome/services/handlers/sitehome-home'; | ||||
| import { makeSingleton } from '@singletons'; | ||||
| import { CoreCourses } from '../courses'; | ||||
| import { CoreCoursesDashboard } from '../dashboard'; | ||||
| import { CoreDashboardHomeHandler } from './dashboard-home'; | ||||
| 
 | ||||
| /** | ||||
|  * Handler to add my courses into home page. | ||||
| @ -53,9 +52,10 @@ export class CoreCoursesMyCoursesHomeHandlerService implements CoreMainMenuHomeH | ||||
|             return false; | ||||
|         } | ||||
| 
 | ||||
|         const blocks = await CoreCoursesDashboard.getDashboardBlocks(undefined, siteId); | ||||
|         const dashboardEnabled = await CoreDashboardHomeHandler.isEnabledForSite(siteId); | ||||
|         const siteHomeEnabled = await CoreSiteHomeHomeHandler.isEnabledForSite(siteId); | ||||
| 
 | ||||
|         return !CoreBlockDelegate.hasSupportedBlock(blocks)&& !CoreSiteHome.isAvailable(siteId); | ||||
|         return !dashboardEnabled && !siteHomeEnabled; | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|  | ||||
| @ -427,13 +427,13 @@ export class CoreIframeUtilsProvider { | ||||
|     /** | ||||
|      * A link inside a frame was clicked. | ||||
|      * | ||||
|      * @param link Data of the link clicked. | ||||
|      * @param link Link clicked, or data of the link clicked. | ||||
|      * @param element Frame element. | ||||
|      * @param event Click event. | ||||
|      * @return Promise resolved when done. | ||||
|      */ | ||||
|     protected async linkClicked( | ||||
|         link: {href: string; target?: string}, | ||||
|         link: CoreIframeHTMLAnchorElement | {href: string; target?: string; originalHref?: string}, | ||||
|         element?: HTMLFrameElement | HTMLObjectElement, | ||||
|         event?: Event, | ||||
|     ): Promise<void> { | ||||
| @ -443,7 +443,8 @@ export class CoreIframeUtilsProvider { | ||||
|         } | ||||
| 
 | ||||
|         const urlParts = CoreUrl.parse(link.href); | ||||
|         if (!link.href || !urlParts || (urlParts.protocol && urlParts.protocol == 'javascript')) { | ||||
|         const originalHref = 'getAttribute' in link ? link.getAttribute('href') : link.originalHref; | ||||
|         if (!link.href || !originalHref || originalHref == '#' || !urlParts || urlParts.protocol == 'javascript') { | ||||
|             // Links with no URL and Javascript links are ignored.
 | ||||
|             return; | ||||
|         } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user