Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Commits on Source (3)
(chore): reduce 100ms to 30ms for scroll subscription debounce
· 0f33f752
Mark Harding
authored
Aug 30, 2019
0f33f752
(feat): prevent regression
· 075e344d
Olivia Madrid
authored
Aug 30, 2019
075e344d
Merge branch 'master' of gitlab.com:minds/front into feat/media-modal-service-1822
· 412bc773
Olivia Madrid
authored
Aug 30, 2019
412bc773
Hide whitespace changes
Inline
Side-by-side
src/app/modules/media/modal/modal.component.ts
View file @
412bc773
...
@@ -260,7 +260,7 @@ export class MediaModalComponent implements OnInit, OnDestroy {
...
@@ -260,7 +260,7 @@ export class MediaModalComponent implements OnInit, OnDestroy {
// After heights are set, check that scaled width isn't too wide or narrow
// After heights are set, check that scaled width isn't too wide or narrow
this
.
maxStageWidth
=
Math
.
max
(
this
.
maxStageWidth
=
Math
.
max
(
window
.
innerWidth
-
this
.
contentWidth
+
this
.
padding
*
2
,
window
.
innerWidth
-
this
.
contentWidth
-
this
.
padding
*
2
,
this
.
minStageWidth
this
.
minStageWidth
);
);
...
...
src/app/services/ux/global-scroll.service.ts
View file @
412bc773
...
@@ -73,7 +73,7 @@ export class GlobalScrollService {
...
@@ -73,7 +73,7 @@ export class GlobalScrollService {
const
viewEmitter
:
EventEmitter
<
any
>
=
new
EventEmitter
<
any
>
();
const
viewEmitter
:
EventEmitter
<
any
>
=
new
EventEmitter
<
any
>
();
if
(
!
subscription
.
viewListener
)
{
if
(
!
subscription
.
viewListener
)
{
subscription
.
viewListener
=
subscription
.
scrollEvent
subscription
.
viewListener
=
subscription
.
scrollEvent
.
pipe
(
debounceTime
(
10
0
))
// wait
10
0ms before triggering
.
pipe
(
debounceTime
(
3
0
))
// wait
3
0ms before triggering
.
subscribe
(
e
=>
{
.
subscribe
(
e
=>
{
viewEmitter
.
next
(
e
);
viewEmitter
.
next
(
e
);
});
});
...
...