diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-02-05 20:54:37 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-02-13 10:25:22 +0100 |
commit | 24e7916c6897bbb38e057cdf1a102286006be964 (patch) | |
tree | 7621dd83d532ba04b725f4feeb902ccbdb6669ff /client/src/app/+accounts | |
parent | eb7c7a517902eae425b05d1ca9cb7f99f76ee71f (diff) | |
download | PeerTube-24e7916c6897bbb38e057cdf1a102286006be964.tar.gz PeerTube-24e7916c6897bbb38e057cdf1a102286006be964.tar.zst PeerTube-24e7916c6897bbb38e057cdf1a102286006be964.zip |
Add ListOverflow component to prevent sub-menu overflow
Diffstat (limited to 'client/src/app/+accounts')
-rw-r--r-- | client/src/app/+accounts/accounts.component.html | 10 | ||||
-rw-r--r-- | client/src/app/+accounts/accounts.component.ts | 8 |
2 files changed, 13 insertions, 5 deletions
diff --git a/client/src/app/+accounts/accounts.component.html b/client/src/app/+accounts/accounts.component.html index 915bee0a2..b982fba9a 100644 --- a/client/src/app/+accounts/accounts.component.html +++ b/client/src/app/+accounts/accounts.component.html | |||
@@ -38,12 +38,12 @@ | |||
38 | </div> | 38 | </div> |
39 | </div> | 39 | </div> |
40 | 40 | ||
41 | <div class="links"> | 41 | <div class="links w-100"> |
42 | <a i18n routerLink="video-channels" routerLinkActive="active" class="title-page">Video channels</a> | 42 | <ng-template #linkTemplate let-item="item"> |
43 | <a [routerLink]="item.routerLink" routerLinkActive="active" class="title-page">{{ item.label }}</a> | ||
44 | </ng-template> | ||
43 | 45 | ||
44 | <a i18n routerLink="videos" routerLinkActive="active" class="title-page">Videos</a> | 46 | <list-overflow [items]="links" [itemTemplate]="linkTemplate"></list-overflow> |
45 | |||
46 | <a i18n routerLink="about" routerLinkActive="active" class="title-page">About</a> | ||
47 | </div> | 47 | </div> |
48 | </div> | 48 | </div> |
49 | 49 | ||
diff --git a/client/src/app/+accounts/accounts.component.ts b/client/src/app/+accounts/accounts.component.ts index a8157de0e..4fea0e4ed 100644 --- a/client/src/app/+accounts/accounts.component.ts +++ b/client/src/app/+accounts/accounts.component.ts | |||
@@ -10,6 +10,7 @@ import { User, UserRight } from '../../../../shared' | |||
10 | import { I18n } from '@ngx-translate/i18n-polyfill' | 10 | import { I18n } from '@ngx-translate/i18n-polyfill' |
11 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' | 11 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' |
12 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' | 12 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' |
13 | import { ListOverflowItem } from '@app/shared/misc/list-overflow.component' | ||
13 | 14 | ||
14 | @Component({ | 15 | @Component({ |
15 | templateUrl: './accounts.component.html', | 16 | templateUrl: './accounts.component.html', |
@@ -19,6 +20,7 @@ export class AccountsComponent implements OnInit, OnDestroy { | |||
19 | account: Account | 20 | account: Account |
20 | accountUser: User | 21 | accountUser: User |
21 | videoChannels: VideoChannel[] = [] | 22 | videoChannels: VideoChannel[] = [] |
23 | links: ListOverflowItem[] = [] | ||
22 | 24 | ||
23 | isAccountManageable = false | 25 | isAccountManageable = false |
24 | accountFollowerTitle = '' | 26 | accountFollowerTitle = '' |
@@ -70,6 +72,12 @@ export class AccountsComponent implements OnInit, OnDestroy { | |||
70 | 72 | ||
71 | err => this.notifier.error(err.message) | 73 | err => this.notifier.error(err.message) |
72 | ) | 74 | ) |
75 | |||
76 | this.links = [ | ||
77 | { label: this.i18n('Video channels'), routerLink: 'video-channels' }, | ||
78 | { label: this.i18n('Videos'), routerLink: 'videos' }, | ||
79 | { label: this.i18n('About'), routerLink: 'about' } | ||
80 | ] | ||
73 | } | 81 | } |
74 | 82 | ||
75 | ngOnDestroy () { | 83 | ngOnDestroy () { |