MCPcopy Index your code
hub / github.com/jabbany/CommentCoreLibrary / init

Method init

src/core/Comment.ts:175–212  ·  view source on GitHub ↗

* Initializes the DOM element (or canvas) backing the comment * This method takes the place of 'initCmt' in the old CCL

(recycle:IComment = null)

Source from the content-addressed store, hash-verified

173 * This method takes the place of 'initCmt' in the old CCL
174 */
175 public init(recycle:IComment = null):void {
176 if (recycle !== null) {
177 this.dom = <HTMLDivElement> recycle.dom;
178 } else {
179 this.dom = document.createElement('div');
180 }
181 this.dom.className = this.parent.options.global.className;
182 this.dom.appendChild(document.createTextNode(this.text));
183 this.dom.textContent = this.text;
184 this.dom.innerText = this.text;
185 this.size = this._size;
186 if (this._color != 0xffffff) {
187 this.color = this._color;
188 }
189 this.shadow = this._shadow;
190 if (this._border) {
191 this.border = this._border;
192 }
193 if (this._font !== '') {
194 this.font = this._font;
195 }
196 if (this._x !== undefined) {
197 this.x = this._x;
198 }
199 if (this._y !== undefined) {
200 this.y = this._y;
201 }
202 if (this._alpha !== 1 || this.parent.options.global.opacity < 1) {
203 this.alpha = this._alpha;
204 }
205 if (this._transform !== null && ! this._transform.isIdentity()) {
206 this.transform = this._transform.flatArray;
207 }
208 if (this.motion.length > 0) {
209 // Force a position update before doing anything
210 this.animate();
211 }
212 }
213
214 get x():number {
215 if (this._x === null || this._x === undefined) {

Callers 5

initMethod · 0.45
bindFunction · 0.45
main.jsFile · 0.45

Calls 2

animateMethod · 0.95
isIdentityMethod · 0.80

Tested by

no test coverage detected