Ensure both Popup and PopupProxy have valid depth
This commit is contained in:
parent
aae971a09e
commit
99ca60d4c1
@ -40,9 +40,9 @@ class Frontend {
|
|||||||
static create() {
|
static create() {
|
||||||
const initializationData = window.frontendInitializationData;
|
const initializationData = window.frontendInitializationData;
|
||||||
const isNested = (initializationData !== null && typeof initializationData === 'object');
|
const isNested = (initializationData !== null && typeof initializationData === 'object');
|
||||||
const {id, parentFrameId, ignoreNodes} = isNested ? initializationData : {};
|
const {id, depth, parentFrameId, ignoreNodes} = isNested ? initializationData : {};
|
||||||
|
|
||||||
const popup = isNested ? new PopupProxy(id, parentFrameId) : PopupProxyHost.instance.createPopup(null);
|
const popup = isNested ? new PopupProxy(depth + 1, id, parentFrameId) : PopupProxyHost.instance.createPopup(null);
|
||||||
const frontend = new Frontend(popup, ignoreNodes);
|
const frontend = new Frontend(popup, ignoreNodes);
|
||||||
frontend.prepare();
|
frontend.prepare();
|
||||||
return frontend;
|
return frontend;
|
||||||
|
@ -18,14 +18,14 @@
|
|||||||
|
|
||||||
|
|
||||||
class PopupProxy {
|
class PopupProxy {
|
||||||
constructor(parentId, parentFrameId) {
|
constructor(depth, parentId, parentFrameId) {
|
||||||
this.parentId = parentId;
|
this.parentId = parentId;
|
||||||
this.parentFrameId = parentFrameId;
|
this.parentFrameId = parentFrameId;
|
||||||
this.id = null;
|
this.id = null;
|
||||||
this.idPromise = null;
|
this.idPromise = null;
|
||||||
this.parent = null;
|
this.parent = null;
|
||||||
this.child = null;
|
this.child = null;
|
||||||
this.depth = 0;
|
this.depth = depth;
|
||||||
|
|
||||||
this.container = null;
|
this.container = null;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user