##// END OF EJS Templates
switched back to dojo-typings module...
switched back to dojo-typings module added skipLibCheck compiler option due to typings sickness prepare for release

File last commit:

r1:b6ccfccf314f default
r4:fc9f82c082ef v1.0.0-rc2 default
Show More
HtmlElementContext.ts
45 lines | 1.2 KiB | video/mp2t | TypeScriptLexer
/ src / main / ts / djx / HtmlElementContext.ts
cin
Initial commit, copied files related to .tsx scripts support.
r0 import dom = require("dojo/dom-construct");
import attr = require("dojo/dom-attr");
import { argumentNotEmptyString } from "@implab/core-amd/safe";
import { BuildContextBase } from "./BuildContextBase";
export class HtmlElementContext extends BuildContextBase {
elementType: string;
cin
typescript strict mode...
r1 _element: HTMLElement | undefined;
cin
Initial commit, copied files related to .tsx scripts support.
r0
constructor(elementType: string) {
argumentNotEmptyString(elementType, "elementType");
super();
this.elementType = elementType;
}
_addChild(child: any): void {
cin
typescript strict mode...
r1 if (!this._element)
throw new Error("The HTML element isn't created");
cin
Initial commit, copied files related to .tsx scripts support.
r0 dom.place(this.getChildDom(child), this._element);
}
_setAttrs(attrs: object): void {
cin
typescript strict mode...
r1 if (!this._element)
throw new Error("The HTML element isn't created");
cin
Initial commit, copied files related to .tsx scripts support.
r0 attr.set(this._element, attrs);
}
_create(attrs: object, children: any[]) {
this._element = dom.create(this.elementType, attrs);
if (children)
children.forEach(v => this._addChild(v));
}
_getDomElement() {
cin
typescript strict mode...
r1 if (!this._element)
throw new Error("The HTML element isn't created");
cin
Initial commit, copied files related to .tsx scripts support.
r0 return this._element;
}
}