MCPcopy Create free account
hub / github.com/NUKnightLab/StoryMapJS / constructor

Method constructor

src/js/ui/Message.js:19–55  ·  view source on GitHub ↗
(data, options, add_to_container)

Source from the content-addressed store, hash-verified

17 /* Constructor
18 ================================================== */
19 constructor(data, options, add_to_container) {
20 // DOM ELEMENTS
21 this._el = {
22 parent: {},
23 container: {},
24 message_container: {},
25 loading_icon: {},
26 message: {}
27 };
28
29 //Options
30 this.options = {
31 width: 600,
32 height: 600,
33 message_class: "vco-message",
34 message_icon_class: "vco-loading-icon"
35 };
36
37 // Merge Data and Options
38 mergeData(this.data, data);
39 mergeData(this.options, options);
40
41 this._el.container = Dom.create("div", this.options.message_class);
42
43 if (add_to_container) {
44 add_to_container.appendChild(this._el.container);
45 this._el.parent = add_to_container;
46 };
47
48
49 // Animation
50 this.animator = {};
51
52
53 this._initLayout();
54 this._initEvents();
55 }
56
57 /* Public
58 ================================================== */

Callers

nothing calls this directly

Calls 4

_initLayoutMethod · 0.95
_initEventsMethod · 0.95
mergeDataFunction · 0.90
createMethod · 0.80

Tested by

no test coverage detected