-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
46 lines (38 loc) · 1.21 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import React from 'react';
import ReactDOM from 'react-dom';
import Card from './src/js/card.jsx';
window.ProtoGraph = window.ProtoGraph || {};
window.ProtoGraph.Card = window.ProtoGraph.Card || {};
ProtoGraph.Card.toDTECourtCase = function() {
this.cardType = 'Down To Earth';
}
ProtoGraph.Card.toDTECourtCase.prototype.init = function(options) {
this.options = options;
}
ProtoGraph.Card.toDTECourtCase.prototype.getData = function(data) {
return this.containerInstance.exportData();
}
ProtoGraph.Card.toDTECourtCase.prototype.renderCol7 = function(data) {
this.mode = 'col7';
this.render();
}
ProtoGraph.Card.toDTECourtCase.prototype.renderCol4 = function(data) {
this.mode = 'col4';
this.render();
}
ProtoGraph.Card.toDTECourtCase.prototype.renderScreenshot = function(data) {
this.mode = 'screenshot';
this.render();
}
ProtoGraph.Card.toDTECourtCase.prototype.render = function() {
ReactDOM.render(
<Card
dataURL={this.options.data_url}
selector={this.options.selector}
clickCallback={this.options.onClickCallback}
mode={this.mode}
ref={(e) => {
this.containerInstance = this.containerInstance || e;
}} />,
this.options.selector);
}