Skip to content

Commit

Permalink
fix(toastr): call contains on body (#1872)
Browse files Browse the repository at this point in the history
  • Loading branch information
yggg committed Aug 26, 2019
1 parent edb6b16 commit a01ec7a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/framework/theme/components/toastr/toastr.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,10 @@ describe('toastr-container-registry', () => {
documentStub = {
_contains: true,

contains: () => {
return documentStub._contains;
body: {
contains: () => {
return documentStub._contains;
},
},
}
});
Expand Down
2 changes: 1 addition & 1 deletion src/framework/theme/components/toastr/toastr.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export class NbToastrContainerRegistry {
}

protected existsInDom(toastContainer: NbToastContainer): boolean {
return this.document.contains(toastContainer.nativeElement);
return this.document.body.contains(toastContainer.nativeElement);
}
}

Expand Down

0 comments on commit a01ec7a

Please sign in to comment.