diff --git a/extra/Pages/prompt.js b/extra/Pages/prompt.js index 9b93486..e6776e8 100644 --- a/extra/Pages/prompt.js +++ b/extra/Pages/prompt.js @@ -4,7 +4,6 @@ import { fadein, fadeout, subCancel } from "../../utils.js"; const call = async (stear, { find, resolve, render, call, event }, { text, autoFill = "" }) => { event.onloaded = () => { fadein(find.main, 200, true); - console.log(find); find.input._.focus(); } event.onresolve = async () => await fadeout(find.main); @@ -56,6 +55,7 @@ const call = async (stear, { find, resolve, render, call, event }, { text, autoF border: "2px solid", borderRadius: "0.5rem", gridRow: "2", + padding:"0.5rem" } }, autoFill), _({ diff --git a/extra/Pages/showStatus.js b/extra/Pages/showStatus.js index aa8455c..2ec9dd9 100644 --- a/extra/Pages/showStatus.js +++ b/extra/Pages/showStatus.js @@ -70,7 +70,9 @@ const call = async (stear, { find, resolve, render, close, call, event }, { text class: "stear_status", style: { border: "2px solid " + next.color, - backgroundColor: first ? "":"#555" + backgroundColor: first ? "":"#555", + userSelect:"none", + cursor:"pointer" }, event: { click: nextMsg } },next.text); diff --git a/main.js b/main.js index 43f9949..7316eff 100644 --- a/main.js +++ b/main.js @@ -524,7 +524,10 @@ export class class_ { * @param {boolean} doBuild */ constructor(settings, childs, doBuild = true) { - this.#elem = document.createElement(settings.type ?? "div"); + const type = settings.type ?? "div"; + if((["circle", "ellipse", "line", "path", "polygon", "polyline", "rect","svg" ]).includes(type)) + this.#elem = document.createElementNS("http://www.w3.org/2000/svg",type); + else this.#elem = document.createElement(type); this.#childs = childs; var keys = Object.keys(settings); for (let i = 0; i < keys.length; i++) { @@ -660,9 +663,9 @@ export class class_ { } else { out[i] = elem.render; } - if (!needReplace &&this.#elem.children[i] != out[i]) needReplace = true; + if (!needReplace && this.#elem.children[i] != out[i]) needReplace = true; } - if (needReplace) this.#elem.replaceChildren(...out); + if (needReplace||out.length==0) this.#elem.replaceChildren(...out); if (this.#dynamicState < 0) this.#dynamicState = -2; return this.#elem; }