Skip to content

Commit fa260c0

Browse files
authored
Merge pull request #814 from PermanentOrg/PER-10316-create-account-sticky-footer-disappears
[PER-10316] Create account sticky footer disappears
2 parents 099851d + 526e28b commit fa260c0

File tree

3 files changed

+8
-49
lines changed

3 files changed

+8
-49
lines changed

src/app/share-preview/components/share-preview-footer/share-preview-footer.component.ts

Lines changed: 8 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -47,44 +47,18 @@ export class SharePreviewFooterComponent implements OnInit, OnDestroy {
4747
private scrollTimestamp: number;
4848

4949
constructor(private renderer: Renderer2) {
50-
this.renderer.listen('window', 'click', (e: Event) => {
51-
if (this.visible) {
52-
if (!this.element.nativeElement.contains(e.target)) {
53-
let target = e.target as HTMLElement;
54-
while (target.parentElement) {
55-
const tagName = target.tagName.toLocaleLowerCase();
56-
if (tagName === 'pr-dialog') {
57-
return;
58-
}
59-
if (tagName === 'pr-app-root') {
60-
break;
61-
}
62-
target = target.parentElement;
63-
}
64-
this.close();
65-
}
66-
}
67-
});
68-
6950
this.renderer.listen('window', 'scroll', (e: Event) => {
7051
if (this.scrollTimeout) {
7152
window.clearTimeout(this.scrollTimeout);
7253
}
73-
if (
74-
window.scrollY + document.body.clientHeight ===
75-
document.body.scrollHeight
76-
) {
77-
this.show();
78-
} else {
79-
this.scrollTimestamp = e.timeStamp;
80-
window.setTimeout(() => {
81-
if (this.scrollTimestamp === e.timeStamp) {
82-
if (!document.querySelector('pr-dialog')) {
83-
this.show();
84-
}
54+
this.scrollTimestamp = e.timeStamp;
55+
window.setTimeout(() => {
56+
if (this.scrollTimestamp === e.timeStamp) {
57+
if (!document.querySelector('pr-dialog')) {
58+
this.show();
8559
}
86-
}, 1000);
87-
}
60+
}
61+
}, 1000);
8862
});
8963
}
9064

@@ -94,9 +68,7 @@ export class SharePreviewFooterComponent implements OnInit, OnDestroy {
9468
});
9569

9670
setTimeout(() => {
97-
if (document.body.scrollHeight === document.body.clientHeight) {
98-
this.show();
99-
}
71+
this.show();
10072
}, 1000);
10173
}
10274

src/app/share-preview/components/share-preview/share-preview.component.spec.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -256,14 +256,6 @@ describe('SharePreviewComponent', () => {
256256
expect(component.showCover).toBeFalse();
257257
});
258258

259-
it('should dispatch banner close', () => {
260-
const spy = jasmine.createSpy();
261-
component.hideBannerObservable.subscribe(spy);
262-
component.dispatchBannerClose();
263-
264-
expect(spy).toHaveBeenCalled();
265-
});
266-
267259
it('should stop event propagation', () => {
268260
const event = jasmine.createSpyObj('Event', ['stopPropagation']);
269261
component.stopPropagation(event);

src/app/share-preview/components/share-preview/share-preview.component.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,6 @@ export class SharePreviewComponent implements OnInit, OnDestroy {
702702
if (this.isUnlistedShare) {
703703
this.showFolder(itemClickEvent);
704704
} else {
705-
this.dispatchBannerClose();
706705
this.showCreateAccountDialog();
707706
}
708707
},
@@ -719,10 +718,6 @@ export class SharePreviewComponent implements OnInit, OnDestroy {
719718
evt.stopPropagation();
720719
}
721720

722-
dispatchBannerClose(): void {
723-
this.hideBannerSubject.next();
724-
}
725-
726721
public navToAuth(): void {
727722
if (this.isRelationshipShare) {
728723
this.router.navigate(['/app', 'auth', 'login']);

0 commit comments

Comments
 (0)