Fix: offsetParent -> parentNode

This commit is contained in:
eight04 2021-12-10 20:29:15 +08:00
parent eb3077d906
commit b0b1ed7e02

View File

@ -143,12 +143,12 @@ function Embed(El) {
async function toggle(state) { async function toggle(state) {
if (state) { if (state) {
if (!el) el = El(); if (!el) el = El();
if (!el.offsetParent) { if (!el.parentNode) {
document.body.append(el); document.body.append(el);
} }
el.focus(); el.focus();
} else { } else {
if (!el || !el.offsetParent) return; if (!el || !el.parentNode) return;
if (el.contentDocument) { if (el.contentDocument) {
el.contentDocument.body.classList.add('scaleout'); el.contentDocument.body.classList.add('scaleout');
} }