MCPcopy
hub / github.com/NUKnightLab/TimelineJS3 / constructor

Method constructor

src/js/media/types/Text.js:6–41  ·  view source on GitHub ↗
(data, options, add_to_container)

Source from the content-addressed store, hash-verified

4
5export class Text {
6 constructor(data, options, add_to_container) {
7
8 this._el = { // defaults
9 container: { },
10 content_container: { },
11 content: { },
12 headline_container: { },
13 headline: { },
14 date: { }
15 }
16
17 this.options = { // defaults
18 title: false
19 }
20
21 this.data = { // defaults
22 unique_id: "",
23 headline: "headline",
24 text: "text"
25 }
26
27 setData(this, data); // override defaults
28
29 // Merge Options
30 mergeData(this.options, options);
31
32 this._el.container = DOM.create("div", "tl-text");
33 this._el.container.id = this.data.unique_id;
34
35 this._initLayout();
36
37 if (add_to_container) {
38 add_to_container.appendChild(this._el.container);
39 };
40
41 }
42
43 /* Adding, Hiding, Showing etc
44 ================================================== */

Callers

nothing calls this directly

Calls 3

_initLayoutMethod · 0.95
setDataFunction · 0.90
mergeDataFunction · 0.90

Tested by

no test coverage detected