MOBILE-3167 blocks: Check block visibility
This commit is contained in:
		
							parent
							
								
									6964c01c77
								
							
						
					
					
						commit
						be6824d58c
					
				| @ -57,8 +57,10 @@ export class CoreBlockComponent implements OnInit, OnDestroy, DoCheck { | ||||
|             return; | ||||
|         } | ||||
| 
 | ||||
|         // Get the data to render the block.
 | ||||
|         this.initBlock(); | ||||
|         if (this.block.visible) { | ||||
|             // Get the data to render the block.
 | ||||
|             this.initBlock(); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|  | ||||
| @ -1,4 +1,4 @@ | ||||
| <!-- Only render the block if it's supported. --> | ||||
| <div *ngIf="loaded && componentClass" class="{{class}}"> | ||||
| <div *ngIf="loaded && componentClass && block.visible" class="{{class}}"> | ||||
|     <core-dynamic-component [component]="componentClass" [data]="data"></core-dynamic-component> | ||||
| </div> | ||||
|  | ||||
| @ -7,7 +7,7 @@ | ||||
|         <ion-list> | ||||
|             <!-- Course blocks. --> | ||||
|             <ng-container *ngFor="let block of blocks"> | ||||
|                 <core-block [block]="block" contextLevel="course" [instanceId]="courseId" [extraData]="{'downloadEnabled': downloadEnabled}"></core-block> | ||||
|                 <core-block *ngIf="block.visible" [block]="block" contextLevel="course" [instanceId]="courseId" [extraData]="{'downloadEnabled': downloadEnabled}"></core-block> | ||||
|             </ng-container> | ||||
|         </ion-list> | ||||
|     </core-loading> | ||||
|  | ||||
| @ -42,7 +42,7 @@ | ||||
|                         <ion-list> | ||||
|                             <!-- Dashboard blocks. --> | ||||
|                             <ng-container *ngFor="let block of blocks"> | ||||
|                                 <core-block [block]="block" contextLevel="user" [instanceId]="userId" [extraData]="{'downloadEnabled': downloadEnabled}"></core-block> | ||||
|                                 <core-block *ngIf="block.visible" [block]="block" contextLevel="user" [instanceId]="userId" [extraData]="{'downloadEnabled': downloadEnabled}"></core-block> | ||||
|                             </ng-container> | ||||
|                         </ion-list> | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user