diff options
author | Kimsible <1877318+kimsible@users.noreply.github.com> | 2020-11-17 14:04:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-17 14:04:44 +0100 |
commit | f3081d6401b63da41b03376f9f952bf1cca8303d (patch) | |
tree | 90ec91babde1544ca0a3423b031c9e10dfcac596 /client/src/app/menu/menu.component.html | |
parent | 901c36d5f44e02436da5f5c2899666329ff2eb5b (diff) | |
download | PeerTube-f3081d6401b63da41b03376f9f952bf1cca8303d.tar.gz PeerTube-f3081d6401b63da41b03376f9f952bf1cca8303d.tar.zst PeerTube-f3081d6401b63da41b03376f9f952bf1cca8303d.zip |
small refactor + clipboard copy on anchor click in instance page (#3318)
* Refacto scrollTo top and anchors
* Add on click clipboard copy and notifier to anchors about/instance page
* Fix margin top anchor middle title about page
* Use viewportscroller for scrolltoanchor
* Add to Link copied notification on instance page
Co-authored-by: kimsible <kimsible@users.noreply.github.com>
Diffstat (limited to 'client/src/app/menu/menu.component.html')
-rw-r--r-- | client/src/app/menu/menu.component.html | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/client/src/app/menu/menu.component.html b/client/src/app/menu/menu.component.html index a5985a301..88e3d60db 100644 --- a/client/src/app/menu/menu.component.html +++ b/client/src/app/menu/menu.component.html | |||
@@ -3,7 +3,7 @@ | |||
3 | <div class="top-menu"> | 3 | <div class="top-menu"> |
4 | <div *ngIf="isLoggedIn" class="logged-in-block"> | 4 | <div *ngIf="isLoggedIn" class="logged-in-block"> |
5 | <div> | 5 | <div> |
6 | <my-avatar-notification [user]="user" (navigate)="onSameUrlRestoreScrollPosition($event)"></my-avatar-notification> | 6 | <my-avatar-notification [user]="user" (navigate)="onActiveLinkScrollToAnchor($event)"></my-avatar-notification> |
7 | 7 | ||
8 | <div class="logged-in-info"> | 8 | <div class="logged-in-info"> |
9 | <a *ngIf="user.account" [routerLink]="[ '/accounts', user.account.nameWithHost ]" class="logged-in-display-name">{{ user.account?.displayName }}</a> | 9 | <a *ngIf="user.account" [routerLink]="[ '/accounts', user.account.nameWithHost ]" class="logged-in-display-name">{{ user.account?.displayName }}</a> |
@@ -22,7 +22,8 @@ | |||
22 | 22 | ||
23 | <div class="dropdown-divider"></div> | 23 | <div class="dropdown-divider"></div> |
24 | 24 | ||
25 | <a ngbDropdownItem ngbDropdownToggle class="dropdown-item" routerLink="/my-account/notifications"> | 25 | <a ngbDropdownItem ngbDropdownToggle class="dropdown-item" routerLink="/my-account/notifications" |
26 | #notifications (click)="onActiveLinkScrollToAnchor(notifications)"> | ||
26 | <my-global-icon iconName="inbox-full" aria-hidden="true"></my-global-icon> <ng-container i18n>My notifications</ng-container> | 27 | <my-global-icon iconName="inbox-full" aria-hidden="true"></my-global-icon> <ng-container i18n>My notifications</ng-container> |
27 | </a> | 28 | </a> |
28 | 29 | ||
@@ -35,7 +36,7 @@ | |||
35 | </a> | 36 | </a> |
36 | 37 | ||
37 | <a ngbDropdownItem ngbDropdownToggle class="dropdown-item" routerLink="/my-account/settings" fragment="video-languages-subtitles" | 38 | <a ngbDropdownItem ngbDropdownToggle class="dropdown-item" routerLink="/my-account/settings" fragment="video-languages-subtitles" |
38 | #settingsLanguagesSubtitles (click)="onSameUrlRestoreScrollPosition(settingsLanguagesSubtitles)"> | 39 | #settingsLanguagesSubtitles (click)="onActiveLinkScrollToAnchor(settingsLanguagesSubtitles)"> |
39 | <my-global-icon iconName="video-lang" aria-hidden="true"></my-global-icon> | 40 | <my-global-icon iconName="video-lang" aria-hidden="true"></my-global-icon> |
40 | <span i18n>Videos:</span> | 41 | <span i18n>Videos:</span> |
41 | <span class="ml-auto text-muted">{{ videoLanguages.join(', ') }}</span> | 42 | <span class="ml-auto text-muted">{{ videoLanguages.join(', ') }}</span> |
@@ -43,7 +44,7 @@ | |||
43 | 44 | ||
44 | <a ngbDropdownItem ngbDropdownToggle class="dropdown-item" routerLink="/my-account/settings" | 45 | <a ngbDropdownItem ngbDropdownToggle class="dropdown-item" routerLink="/my-account/settings" |
45 | fragment="video-sensitive-content-policy" #settingsSensitiveContentPolicy | 46 | fragment="video-sensitive-content-policy" #settingsSensitiveContentPolicy |
46 | (click)="onSameUrlRestoreScrollPosition(settingsSensitiveContentPolicy)"> | 47 | (click)="onActiveLinkScrollToAnchor(settingsSensitiveContentPolicy)"> |
47 | <my-global-icon class="hover-display-toggle" [ngClass]="{ 'not-displayed': user.nsfwPolicy === 'display' }" iconName="sensitive" aria-hidden="true"></my-global-icon> | 48 | <my-global-icon class="hover-display-toggle" [ngClass]="{ 'not-displayed': user.nsfwPolicy === 'display' }" iconName="sensitive" aria-hidden="true"></my-global-icon> |
48 | <my-global-icon class="hover-display-toggle" [ngClass]="{ 'not-displayed': user.nsfwPolicy !== 'display' }" iconName="unsensitive" aria-hidden="true"></my-global-icon> | 49 | <my-global-icon class="hover-display-toggle" [ngClass]="{ 'not-displayed': user.nsfwPolicy !== 'display' }" iconName="unsensitive" aria-hidden="true"></my-global-icon> |
49 | <span i18n>Sensitive:</span> | 50 | <span i18n>Sensitive:</span> |
@@ -72,12 +73,12 @@ | |||
72 | </div> | 73 | </div> |
73 | 74 | ||
74 | <div class="logged-in-menu"> | 75 | <div class="logged-in-menu"> |
75 | <a routerLink="/my-account" routerLinkActive="active" #settingsLink (click)="onSameUrlRestoreScrollPosition(settingsLink)"> | 76 | <a routerLink="/my-account" routerLinkActive="active" #settingsLink (click)="onActiveLinkScrollToAnchor(settingsLink)"> |
76 | <my-global-icon iconName="user" aria-hidden="true"></my-global-icon> | 77 | <my-global-icon iconName="user" aria-hidden="true"></my-global-icon> |
77 | <ng-container i18n>My account</ng-container> | 78 | <ng-container i18n>My account</ng-container> |
78 | </a> | 79 | </a> |
79 | 80 | ||
80 | <a routerLink="/my-library" routerLinkActive="active" #libraryLink (click)="onSameUrlRestoreScrollPosition(libraryLink)"> | 81 | <a routerLink="/my-library" routerLinkActive="active" #libraryLink (click)="onActiveLinkScrollToAnchor(libraryLink)"> |
81 | <my-global-icon iconName="channel" aria-hidden="true"></my-global-icon> | 82 | <my-global-icon iconName="channel" aria-hidden="true"></my-global-icon> |
82 | <ng-container i18n>My library</ng-container> | 83 | <ng-container i18n>My library</ng-container> |
83 | </a> | 84 | </a> |