diff options
author | Kim <1877318+kimsible@users.noreply.github.com> | 2020-08-17 10:13:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-17 10:13:31 +0200 |
commit | 30d55e75cae1adec3fc43c84691975bf8b97db34 (patch) | |
tree | 74df7fabda72d88b60d6d8d20ba9cd95d1cf4858 /client/src/app/app.component.ts | |
parent | 28fbb88f93859a7f6bbf124cb8df1e1a37fd1285 (diff) | |
download | PeerTube-30d55e75cae1adec3fc43c84691975bf8b97db34.tar.gz PeerTube-30d55e75cae1adec3fc43c84691975bf8b97db34.tar.zst PeerTube-30d55e75cae1adec3fc43c84691975bf8b97db34.zip |
Add restore scroll position on user-dropdown anchors links and scroll to top on active sub-menu links (#3066)
* Add restore scroll position on router same url
* Remove settings top anchor
* Add scrollToTop on active links fixed sub-menu
* Add restore scroll position on notification avatar links
* Toggle menu and close pophover when click on active dropdown menu-left link
* Add onSameUrlRestoreScrollPosition on user dropdown channels link
* Same behavior scrollTop and scroll to anchor everywhere
Co-authored-by: kimsible <kimsible@users.noreply.github.com>
Diffstat (limited to 'client/src/app/app.component.ts')
-rw-r--r-- | client/src/app/app.component.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts index ef0b1ae56..b8af4e2c7 100644 --- a/client/src/app/app.component.ts +++ b/client/src/app/app.component.ts | |||
@@ -121,7 +121,7 @@ export class AppComponent implements OnInit, AfterViewInit { | |||
121 | // scrollToAnchor first to preserve anchor position when using history navigation | 121 | // scrollToAnchor first to preserve anchor position when using history navigation |
122 | if (e.anchor) { | 122 | if (e.anchor) { |
123 | setTimeout(() => { | 123 | setTimeout(() => { |
124 | this.viewportScroller.scrollToAnchor(e.anchor) | 124 | document.getElementById(e.anchor).scrollIntoView({ behavior: 'smooth', inline: 'nearest' }) |
125 | }) | 125 | }) |
126 | 126 | ||
127 | return | 127 | return |