aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app')
-rw-r--r--client/src/app/shared/shared-forms/markdown-textarea.component.ts9
1 files changed, 8 insertions, 1 deletions
diff --git a/client/src/app/shared/shared-forms/markdown-textarea.component.ts b/client/src/app/shared/shared-forms/markdown-textarea.component.ts
index 8dad5314c..d47f22d1d 100644
--- a/client/src/app/shared/shared-forms/markdown-textarea.component.ts
+++ b/client/src/app/shared/shared-forms/markdown-textarea.component.ts
@@ -1,3 +1,4 @@
1import { ViewportScroller } from '@angular/common'
1import truncate from 'lodash-es/truncate' 2import truncate from 'lodash-es/truncate'
2import { Subject } from 'rxjs' 3import { Subject } from 'rxjs'
3import { debounceTime, distinctUntilChanged } from 'rxjs/operators' 4import { debounceTime, distinctUntilChanged } from 'rxjs/operators'
@@ -35,8 +36,12 @@ export class MarkdownTextareaComponent implements ControlValueAccessor, OnInit {
35 isMaximized = false 36 isMaximized = false
36 37
37 private contentChanged = new Subject<string>() 38 private contentChanged = new Subject<string>()
39 private scrollPosition: [number, number]
38 40
39 constructor (private markdownService: MarkdownService) {} 41 constructor (
42 private viewportScroller: ViewportScroller,
43 private markdownService: MarkdownService
44 ) { }
40 45
41 ngOnInit () { 46 ngOnInit () {
42 this.contentChanged 47 this.contentChanged
@@ -86,11 +91,13 @@ export class MarkdownTextareaComponent implements ControlValueAccessor, OnInit {
86 } 91 }
87 92
88 private lockBodyScroll () { 93 private lockBodyScroll () {
94 this.scrollPosition = this.viewportScroller.getScrollPosition()
89 document.getElementById('content').classList.add('lock-scroll') 95 document.getElementById('content').classList.add('lock-scroll')
90 } 96 }
91 97
92 private unlockBodyScroll () { 98 private unlockBodyScroll () {
93 document.getElementById('content').classList.remove('lock-scroll') 99 document.getElementById('content').classList.remove('lock-scroll')
100 this.viewportScroller.scrollToPosition(this.scrollPosition)
94 } 101 }
95 102
96 private async updatePreviews () { 103 private async updatePreviews () {