aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+my-library
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-03-21 11:40:25 +0100
committerChocobozzz <me@florianbigard.com>2022-03-21 11:40:25 +0100
commit439b6b7bfb5243f016135ccbd13a3491741cf809 (patch)
tree1ec604ce2c65b2a82788e3ab82ae10f57e7e7c75 /client/src/app/+my-library
parent11d70211afce6ead1ebe242372be9199c4f0bd4e (diff)
downloadPeerTube-439b6b7bfb5243f016135ccbd13a3491741cf809.tar.gz
PeerTube-439b6b7bfb5243f016135ccbd13a3491741cf809.tar.zst
PeerTube-439b6b7bfb5243f016135ccbd13a3491741cf809.zip
Lazy load charts when listing my channels
Diffstat (limited to 'client/src/app/+my-library')
-rw-r--r--client/src/app/+my-library/+my-video-channels/my-video-channels.component.html12
-rw-r--r--client/src/app/+my-library/+my-video-channels/my-video-channels.component.scss7
2 files changed, 14 insertions, 5 deletions
diff --git a/client/src/app/+my-library/+my-video-channels/my-video-channels.component.html b/client/src/app/+my-library/+my-video-channels/my-video-channels.component.html
index c1ded0f6d..89327b065 100644
--- a/client/src/app/+my-library/+my-video-channels/my-video-channels.component.html
+++ b/client/src/app/+my-library/+my-video-channels/my-video-channels.component.html
@@ -41,8 +41,16 @@
41 <my-delete-button label (click)="deleteVideoChannel(videoChannel)"></my-delete-button> 41 <my-delete-button label (click)="deleteVideoChannel(videoChannel)"></my-delete-button>
42 </div> 42 </div>
43 43
44 <div *ngIf="!isInSmallView" class="w-100 d-flex justify-content-end"> 44 <div *ngIf="!isInSmallView" class="w-100 d-flex justify-content-end chart-container">
45 <p-chart *ngIf="chartOptions && videoChannelsChartData && videoChannelsChartData[i]" type="line" [data]="videoChannelsChartData[i]" [options]="chartOptions" width="40vw" height="100px"></p-chart> 45 <div myDeferLoading>
46 <ng-template>
47 <p-chart
48 *ngIf="chartOptions && videoChannelsChartData && videoChannelsChartData[i]"
49 width="40vw" height="100px"
50 type="line" [data]="videoChannelsChartData[i]" [options]="chartOptions"
51 ></p-chart>
52 </ng-template>
53 </div>
46 </div> 54 </div>
47 </div> 55 </div>
48 </div> 56 </div>
diff --git a/client/src/app/+my-library/+my-video-channels/my-video-channels.component.scss b/client/src/app/+my-library/+my-video-channels/my-video-channels.component.scss
index 484355967..ab80f3d01 100644
--- a/client/src/app/+my-library/+my-video-channels/my-video-channels.component.scss
+++ b/client/src/app/+my-library/+my-video-channels/my-video-channels.component.scss
@@ -62,9 +62,10 @@ my-edit-button {
62 min-width: 190px; 62 min-width: 190px;
63} 63}
64 64
65::ng-deep .chartjs-render-monitor { 65.chart-container {
66 position: relative; 66 // Sync these values with the template
67 top: 1px; 67 width: 40vw;
68 height: 100px;
68} 69}
69 70
70.video-channels-header { 71.video-channels-header {