@rivet-health/design-system 3.0.1 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/modal/callout/lock-scroll.directive.mjs +10 -5
- package/fesm2015/rivet-health-design-system.mjs +9 -4
- package/fesm2015/rivet-health-design-system.mjs.map +1 -1
- package/fesm2020/rivet-health-design-system.mjs +9 -4
- package/fesm2020/rivet-health-design-system.mjs.map +1 -1
- package/lib/modal/callout/lock-scroll.directive.d.ts +1 -0
- package/package.json +1 -1
|
@@ -575,6 +575,9 @@ class LockScrollContextService {
|
|
|
575
575
|
this.stack = 0;
|
|
576
576
|
this.scrollPosition = 0;
|
|
577
577
|
}
|
|
578
|
+
getContext() {
|
|
579
|
+
return this.stack;
|
|
580
|
+
}
|
|
578
581
|
pushContext() {
|
|
579
582
|
return ++this.stack;
|
|
580
583
|
}
|
|
@@ -595,16 +598,18 @@ class LockScrollDirective {
|
|
|
595
598
|
}
|
|
596
599
|
ngOnInit() {
|
|
597
600
|
if (this.lock) {
|
|
598
|
-
const
|
|
599
|
-
|
|
601
|
+
const oldContext = this.context.getContext();
|
|
602
|
+
const newContext = this.context.pushContext();
|
|
603
|
+
if (oldContext === 0 && newContext === 1) {
|
|
600
604
|
this.lockScroll();
|
|
601
605
|
}
|
|
602
606
|
}
|
|
603
607
|
}
|
|
604
608
|
ngOnDestroy() {
|
|
605
609
|
if (this.lock) {
|
|
606
|
-
const
|
|
607
|
-
|
|
610
|
+
const oldContext = this.context.getContext();
|
|
611
|
+
const newContext = this.context.popContext();
|
|
612
|
+
if (oldContext === 1 && newContext === 0) {
|
|
608
613
|
this.unlockScroll();
|
|
609
614
|
}
|
|
610
615
|
}
|