Merge pull request #2113 from crazyserver/MOBILE-3167
MOBILE-3167 blocks: Check block visibilitymain
commit
bcb41032f5
|
@ -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…
Reference in New Issue