-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathown-contest.js
39 lines (30 loc) · 905 Bytes
/
own-contest.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
let emoji_list = []
let renderDropDown = (DOMElement, list) => {
var dropDown = d3.select(DOMElement)
.append("select")
.attr("class", "selection")
.attr("name", "emoji-list")
dropDown
.append('option')
.text('Select emoji')
.attr('disabled', 'true')
.attr('class', 'disable');
var options = dropDown
.selectAll("option:not([disabled])")
.data(list)
.enter()
.append("option");
options
.text(d => d.char)
.attr("value", d => d.id);
$("#emoji-dropdown-left select").change(() => {
own_fight.left = [$('#emoji-dropdown-left select').val()];
own_fight.render();
});
$("#emoji-dropdown-right select").change(() => {
own_fight.right = [$('#emoji-dropdown-right select').val()];
own_fight.render();
});
}
// $('#emoji-dropdown-left select').val();
// $('#emoji-dropdown-right select').val();