This commit is contained in:
jusax23 2022-12-19 23:03:37 +01:00
parent 90ea9df537
commit e719102dec
3 changed files with 10 additions and 5 deletions

View file

@ -4,7 +4,6 @@ import { fadein, fadeout, subCancel } from "../../utils.js";
const call = async (stear, { find, resolve, render, call, event }, { text, autoFill = "" }) => { const call = async (stear, { find, resolve, render, call, event }, { text, autoFill = "" }) => {
event.onloaded = () => { event.onloaded = () => {
fadein(find.main, 200, true); fadein(find.main, 200, true);
console.log(find);
find.input._.focus(); find.input._.focus();
} }
event.onresolve = async () => await fadeout(find.main); 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", border: "2px solid",
borderRadius: "0.5rem", borderRadius: "0.5rem",
gridRow: "2", gridRow: "2",
padding:"0.5rem"
} }
}, autoFill), }, autoFill),
_({ _({

View file

@ -70,7 +70,9 @@ const call = async (stear, { find, resolve, render, close, call, event }, { text
class: "stear_status", class: "stear_status",
style: { style: {
border: "2px solid " + next.color, border: "2px solid " + next.color,
backgroundColor: first ? "":"#555" backgroundColor: first ? "":"#555",
userSelect:"none",
cursor:"pointer"
}, },
event: { click: nextMsg } event: { click: nextMsg }
},next.text); },next.text);

View file

@ -524,7 +524,10 @@ export class class_ {
* @param {boolean} doBuild * @param {boolean} doBuild
*/ */
constructor(settings, childs, doBuild = true) { 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; this.#childs = childs;
var keys = Object.keys(settings); var keys = Object.keys(settings);
for (let i = 0; i < keys.length; i++) { for (let i = 0; i < keys.length; i++) {
@ -660,9 +663,9 @@ export class class_ {
} else { } else {
out[i] = elem.render; 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; if (this.#dynamicState < 0) this.#dynamicState = -2;
return this.#elem; return this.#elem;
} }