|
|
|
@ -319,29 +319,31 @@ export class HtmlTag {
|
|
|
|
|
t: HTMLElement;
|
|
|
|
|
a: HTMLElement;
|
|
|
|
|
|
|
|
|
|
constructor(html: string, anchor: HTMLElement = null) {
|
|
|
|
|
this.e = element('div');
|
|
|
|
|
constructor(anchor: HTMLElement = null) {
|
|
|
|
|
this.a = anchor;
|
|
|
|
|
this.u(html);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m(target: HTMLElement, anchor: HTMLElement = null) {
|
|
|
|
|
for (let i = 0; i < this.n.length; i += 1) {
|
|
|
|
|
insert(target, this.n[i], anchor);
|
|
|
|
|
m(html: string, target: HTMLElement, anchor: HTMLElement = null) {
|
|
|
|
|
if (!this.e) {
|
|
|
|
|
this.e = element(target.nodeName as keyof HTMLElementTagNameMap);
|
|
|
|
|
this.t = target;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.t = target;
|
|
|
|
|
this.u(html, anchor);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
u(html: string) {
|
|
|
|
|
u(html: string, anchor) {
|
|
|
|
|
this.e.innerHTML = html;
|
|
|
|
|
this.n = Array.from(this.e.childNodes);
|
|
|
|
|
|
|
|
|
|
for (let i = 0; i < this.n.length; i += 1) {
|
|
|
|
|
insert(this.t, this.n[i], anchor);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
p(html: string) {
|
|
|
|
|
this.d();
|
|
|
|
|
this.u(html);
|
|
|
|
|
this.m(this.t, this.a);
|
|
|
|
|
this.u(html, this.a);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
d() {
|
|
|
|
|