##// END OF EJS Templates
Merge
Merge

File last commit:

r59:bcdd096122ff default
r62:141ef477a5ff merge default
Show More
HtmlElementContext.ts
37 lines | 998 B | video/mp2t | TypeScriptLexer
/ src / main / ts / tsx / HtmlElementContext.ts
cin
sync
r7 import dom = require("dojo/dom-construct");
import { argumentNotEmptyString } from "@implab/core-amd/safe";
import { BuildContextBase } from "./BuildContextBase";
cin
Switched to dojo-typings...
r22 export class HtmlElementContext extends BuildContextBase<HTMLElement> {
cin
sync
r7 elementType: string;
_element: HTMLElement | undefined;
constructor(elementType: string) {
argumentNotEmptyString(elementType, "elementType");
super();
this.elementType = elementType;
}
_addChild(child: any): void {
if (!this._element)
throw new Error("The HTML element isn't created");
cin
DjxFragment converted to functionl component...
r59 dom.place(this.getItemDom(child), this._element);
cin
sync
r7 }
_create(attrs: object, children: any[]) {
this._element = dom.create(this.elementType, attrs);
if (children)
children.forEach(v => this._addChild(v));
}
cin
Added DjxFragment...
r19 _getDomNode() {
cin
sync
r7 if (!this._element)
throw new Error("The HTML element isn't created");
return this._element;
}
}