forked from gitter-badger/etheropt.github.io
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathscript.js
65 lines (65 loc) · 2.76 KB
/
script.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
$(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.order($('#buy_option').val(), $('#buy_price').val(), $('#buy_size').val(), $('#buy_order').val());
});
$('#buy_modal').on('show.bs.modal', function(e) {
var option = JSON.stringify($(e.relatedTarget).data('option'));
$(e.currentTarget).find('input[id="buy_option"]').val(option);
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.order($('#sell_option').val(), $('#sell_price').val(), -$('#sell_size').val(), $('#sell_order').val());
});
$('#sell_modal').on('show.bs.modal', function(e) {
var option = JSON.stringify($(e.relatedTarget).data('option'));
$(e.currentTarget).find('input[id="sell_option"]').val(option);
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);
});
});
$(function() {
$('.clickable').on('click',function(){
var effect = $(this).data('effect');
$(this).closest('.panel')[effect]();
});
});