Fix intersaction Observer in app, communities and learn-how.
This commit is contained in:
parent
a03d41be9c
commit
6920159b10
|
@ -524,8 +524,7 @@ export class AppComponent implements OnInit, OnDestroy {
|
||||||
restrictedData ? "" : "/myCommunities", false, [], [], {}));
|
restrictedData ? "" : "/myCommunities", false, [], [], {}));
|
||||||
}
|
}
|
||||||
this.showMenu = true;
|
this.showMenu = true;
|
||||||
// if (typeof document !== "undefined" && this.bottom) {
|
if (typeof IntersectionObserver !== "undefined") {
|
||||||
if (typeof document !== "undefined" && properties && this.isClient && this.showMenu) {
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.createObservers();
|
this.createObservers();
|
||||||
});
|
});
|
||||||
|
|
|
@ -92,7 +92,8 @@ export class CommunitiesComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||||
this.subscriptions.forEach(subscription => {
|
this.subscriptions.forEach(subscription => {
|
||||||
if (subscription instanceof Subscriber) {
|
if (subscription instanceof Subscriber) {
|
||||||
subscription.unsubscribe();
|
subscription.unsubscribe();
|
||||||
} else if (subscription instanceof IntersectionObserver || subscription instanceof MutationObserver) {
|
} else if ((typeof MutationObserver != 'undefined' && subscription instanceof MutationObserver) ||
|
||||||
|
(typeof IntersectionObserver != 'undefined' && subscription instanceof IntersectionObserver)) {
|
||||||
subscription.disconnect();
|
subscription.disconnect();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -100,7 +101,7 @@ export class CommunitiesComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngAfterViewInit() {
|
ngAfterViewInit() {
|
||||||
if(typeof window !== "undefined") {
|
if(typeof IntersectionObserver !== "undefined" && typeof MutationObserver !== "undefined") {
|
||||||
this.createObservers();
|
this.createObservers();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -279,12 +279,14 @@ export class LearnHowComponent implements OnInit {
|
||||||
this.subscriptions.forEach(subscription => {
|
this.subscriptions.forEach(subscription => {
|
||||||
if (subscription instanceof Subscriber) {
|
if (subscription instanceof Subscriber) {
|
||||||
subscription.unsubscribe();
|
subscription.unsubscribe();
|
||||||
|
} else if(typeof IntersectionObserver !== 'undefined' && subscription instanceof IntersectionObserver) {
|
||||||
|
subscription.disconnect();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
ngAfterViewInit() {
|
ngAfterViewInit() {
|
||||||
if (typeof window !== "undefined") {
|
if (typeof IntersectionObserver !== "undefined") {
|
||||||
this.createObservers();
|
this.createObservers();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 2f989107123ae674aba4907b113e4498a8f87786
|
Subproject commit 4700cc82c866ed86158234f706fc52360bc34637
|
Loading…
Reference in New Issue