forked from gitter-badger/etheropt.github.io
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathscript.js
More file actions
55 lines (55 loc) · 2.27 KB
/
script.js
File metadata and controls
55 lines (55 loc) · 2.27 KB
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
47
48
49
50
51
52
53
54
55
$(function () {
$('body').on('click', '#address_submit', function (e) {
e.preventDefault();
$('#address_modal').modal('hide');
bundle.Main.addAddress($('#address_addr').val(), $('#address_pk').val());
});
});
$(function () {
$('body').on('click', '#fund_submit', function (e) {
e.preventDefault();
$('#fund_modal').modal('hide');
bundle.Main.fund($('#fund_amount').val());
});
});
$(function () {
$('body').on('click', '#withdraw_submit', function (e) {
e.preventDefault();
$('#withdraw_modal').modal('hide');
bundle.Main.withdraw($('#withdraw_amount').val());
});
});
$(function () {
$('body').on('click', '#buy_submit', function (e) {
e.preventDefault();
$('#buy_modal').modal('hide');
bundle.Main.buy($('#buy_order').val(), $('#buy_price').val(), $('#buy_size').val());
});
$('#buy_modal').on('show.bs.modal', function(e) {
var order = JSON.stringify($(e.relatedTarget).data('order'));
$(e.currentTarget).find('input[id="buy_order"]').val(order);
var price = $(e.relatedTarget).data('price');
$(e.currentTarget).find('input[id="buy_price"]').val(price);
var size = $(e.relatedTarget).data('size');
$(e.currentTarget).find('input[id="buy_size"]').val(size);
var description = $(e.relatedTarget).data('description');
$(e.currentTarget).find('#buy_description').html(description);
});
});
$(function () {
$('body').on('click', '#sell_submit', function (e) {
e.preventDefault();
$('#sell_modal').modal('hide');
bundle.Main.sell($('#sell_order').val(), $('#sell_price').val(), $('#sell_size').val());
});
$('#sell_modal').on('show.bs.modal', function(e) {
var order = JSON.stringify($(e.relatedTarget).data('order'));
$(e.currentTarget).find('input[id="sell_order"]').val(order);
var price = $(e.relatedTarget).data('price');
$(e.currentTarget).find('input[id="sell_price"]').val(price);
var size = $(e.relatedTarget).data('size');
$(e.currentTarget).find('input[id="sell_size"]').val(size);
var description = $(e.relatedTarget).data('description');
$(e.currentTarget).find('#sell_description').html(description);
});
});