From 3994dc115fa04a0f1e6d2af740db18c10eb475d5 Mon Sep 17 00:00:00 2001 From: jusax23 Date: Fri, 10 Jun 2022 23:00:47 +0200 Subject: [PATCH] close --- main.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index dded285..eb38b92 100644 --- a/main.js +++ b/main.js @@ -108,11 +108,14 @@ export class SFrame{ return find; }, resolve: (r,close=true)=>{ - if (close&&[...(stear.elem.children)].indexOf(this.#lastRender._) >= 0) stear.elem.removeChild(this.#lastRender._); + if (close&&this.#lastRender&&[...(stear.elem.children)].indexOf(this.#lastRender._) >= 0) stear.elem.removeChild(this.#lastRender._); res(r); }, call: (elem, args)=>{ return stear.call(elem,args,layer+1); + }, + close: ()=>{ + if (close && this.#lastRender && [...(stear.elem.children)].indexOf(this.#lastRender._) >= 0) stear.elem.removeChild(this.#lastRender._); } }, args); });