MOBILE-3167 blocks: Check block visibility
parent
6964c01c77
commit
be6824d58c
|
@ -57,9 +57,11 @@ export class CoreBlockComponent implements OnInit, OnDestroy, DoCheck {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.block.visible) {
|
||||||
// Get the data to render the block.
|
// Get the data to render the block.
|
||||||
this.initBlock();
|
this.initBlock();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Detect and act upon changes that Angular can’t or won’t detect on its own (objects and arrays).
|
* Detect and act upon changes that Angular can’t or won’t detect on its own (objects and arrays).
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<!-- Only render the block if it's supported. -->
|
<!-- 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>
|
<core-dynamic-component [component]="componentClass" [data]="data"></core-dynamic-component>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<ion-list>
|
<ion-list>
|
||||||
<!-- Course blocks. -->
|
<!-- Course blocks. -->
|
||||||
<ng-container *ngFor="let block of 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>
|
</ng-container>
|
||||||
</ion-list>
|
</ion-list>
|
||||||
</core-loading>
|
</core-loading>
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
<ion-list>
|
<ion-list>
|
||||||
<!-- Dashboard blocks. -->
|
<!-- Dashboard blocks. -->
|
||||||
<ng-container *ngFor="let block of 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>
|
</ng-container>
|
||||||
</ion-list>
|
</ion-list>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue