##// END OF EJS Templates
Fixed scheduleRender context restoration
Fixed scheduleRender context restoration

File last commit:

r102:c65ea2350b1a v1.3
r122:fb2ea4d6aaba v1.6.3 default
Show More
HtmlRendition.ts
50 lines | 1.4 KiB | video/mp2t | TypeScriptLexer
/ djx / src / main / ts / tsx / HtmlRendition.ts
cin
Testing nested watch, release candidate
r101 import djDom = require("dojo/dom-construct");
import djAttr = require("dojo/dom-attr");
cin
Converted to subproject djx, removed dojo-typings
r65 import { argumentNotEmptyString } from "@implab/core-amd/safe";
import { RenditionBase } from "./RenditionBase";
cin
refactoring, adding scope to rendering methods
r96 import { placeAt } from "./traits";
cin
`Subscribable` is made compatible with rxjs, added map, filter and scan...
r102 import { getItemDom, refHook } from "./render";
cin
Converted to subproject djx, removed dojo-typings
r65
cin
Testing nested watch, release candidate
r101 export class HtmlRendition extends RenditionBase<Element> {
cin
Converted to subproject djx, removed dojo-typings
r65 elementType: string;
cin
Testing nested watch, release candidate
r101 _element: Element | undefined;
cin
Converted to subproject djx, removed dojo-typings
r65
constructor(elementType: string) {
argumentNotEmptyString(elementType, "elementType");
super();
this.elementType = elementType;
}
cin
`Subscribable` is made compatible with rxjs, added map, filter and scan...
r102 _addChild(child: unknown): void {
cin
Converted to subproject djx, removed dojo-typings
r65 if (!this._element)
throw new Error("The HTML element isn't created");
cin
Testing nested watch, release candidate
r101 placeAt(getItemDom(child), this._element);
cin
Converted to subproject djx, removed dojo-typings
r65 }
cin
`Subscribable` is made compatible with rxjs, added map, filter and scan...
r102 _create({ xmlns, ref, ...attrs }: { xmlns?: string, ref?: JSX.Ref<Element> }, children: unknown[]) {
cin
Testing nested watch, release candidate
r101
if (xmlns) {
this._element = document.createElementNS(xmlns, this.elementType);
djAttr.set(this._element, attrs);
} else {
this._element = djDom.create(this.elementType, attrs);
}
cin
Converted to subproject djx, removed dojo-typings
r65
cin
`Subscribable` is made compatible with rxjs, added map, filter and scan...
r102 children.forEach(v => this._addChild(v));
cin
Testing nested watch, release candidate
r101
const element = this._element;
if (ref)
cin
`Subscribable` is made compatible with rxjs, added map, filter and scan...
r102 refHook(element, ref);
cin
Converted to subproject djx, removed dojo-typings
r65 }
_getDomNode() {
if (!this._element)
throw new Error("The HTML element isn't created");
return this._element;
}
}