fix(docs-infra): removal of the use of the ChildNode.remove() method that it isn't supported by IE (#28188)
fixes #28177 PR Close #28188
This commit is contained in:
parent
cb93027f32
commit
eb8ccf65d1
@ -100,9 +100,10 @@ export class DocViewerComponent implements OnDestroy {
|
|||||||
if (needsToc && !embeddedToc) {
|
if (needsToc && !embeddedToc) {
|
||||||
// Add an embedded ToC if it's needed and there isn't one in the content already.
|
// Add an embedded ToC if it's needed and there isn't one in the content already.
|
||||||
titleEl!.insertAdjacentHTML('afterend', '<aio-toc class="embedded"></aio-toc>');
|
titleEl!.insertAdjacentHTML('afterend', '<aio-toc class="embedded"></aio-toc>');
|
||||||
} else if (!needsToc && embeddedToc) {
|
} else if (!needsToc && embeddedToc && embeddedToc.parentNode !== null) {
|
||||||
// Remove the embedded Toc if it's there and not needed.
|
// Remove the embedded Toc if it's there and not needed.
|
||||||
embeddedToc.remove();
|
// We cannot use ChildNode.remove() because of IE11
|
||||||
|
embeddedToc.parentNode.removeChild(embeddedToc);
|
||||||
}
|
}
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
|
@ -68,7 +68,10 @@ export class TocService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// now remove the anchor
|
// now remove the anchor
|
||||||
anchorLink.remove();
|
if (anchorLink.parentNode !== null) {
|
||||||
|
// We cannot use ChildNode.remove() because of IE11
|
||||||
|
anchorLink.parentNode.removeChild(anchorLink);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// security: the document element which provides this heading content
|
// security: the document element which provides this heading content
|
||||||
// is always authored by the documentation team and is considered to be safe
|
// is always authored by the documentation team and is considered to be safe
|
||||||
|
Loading…
x
Reference in New Issue
Block a user