(data, options, add_to_container)
| 4 | |
| 5 | export 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 | ================================================== */ |
nothing calls this directly
no test coverage detected