change Popup.children to Popup.child
This commit is contained in:
parent
97be029dee
commit
2df9a7f977
@ -57,7 +57,7 @@ class PopupProxyHost {
|
||||
const popup = new Popup(id, depth, this.frameIdPromise);
|
||||
if (parent !== null) {
|
||||
popup.parent = parent;
|
||||
parent.children.push(popup);
|
||||
parent.child = popup;
|
||||
}
|
||||
this.popups[id] = popup;
|
||||
return popup;
|
||||
|
@ -24,7 +24,7 @@ class PopupProxy {
|
||||
this.id = null;
|
||||
this.idPromise = null;
|
||||
this.parent = null;
|
||||
this.children = [];
|
||||
this.child = null;
|
||||
this.depth = 0;
|
||||
|
||||
this.container = null;
|
||||
|
@ -24,7 +24,7 @@ class Popup {
|
||||
this.frameIdPromise = frameIdPromise;
|
||||
this.frameId = null;
|
||||
this.parent = null;
|
||||
this.children = [];
|
||||
this.child = null;
|
||||
this.container = document.createElement('iframe');
|
||||
this.container.id = 'yomichan-float';
|
||||
this.container.addEventListener('mousedown', e => e.stopPropagation());
|
||||
@ -212,19 +212,9 @@ class Popup {
|
||||
}
|
||||
|
||||
hideChildren() {
|
||||
if (this.children.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
const targets = this.children.slice(0);
|
||||
while (targets.length > 0) {
|
||||
const target = targets.shift();
|
||||
if (target.isContainerHidden()) { continue; }
|
||||
|
||||
target.hide();
|
||||
for (const child of target.children) {
|
||||
targets.push(child);
|
||||
}
|
||||
// recursively hides all children
|
||||
if (this.child && !this.child.isContainerHidden()) {
|
||||
this.child.hide();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user