-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
33 lines (26 loc) · 847 Bytes
/
index.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
'use strict';
const $ = require('jquery');
const client = require('./src/js/monzo');
const render = require('./src/js/render');
const mapHandler = require('./src/js/map');
function addLogin() {
const clientLoginButton = $('.client-login-button'); // TODO: get rid of jquery
const tokenLoginButton = $('.token-login-button');
tokenLoginButton.on("click", (event) => {
event.preventDefault();
const token = $('.input-access-token').val();
$('.input-access-token').val('');
render.startLoadAnimation();
client.getAndDisplayBalance(token);
client.getAndDisplayTransactions(token);
});
clientLoginButton.on("click", (event) => {
event.preventDefault();
});
}
function init() {
addLogin();
render.startLoadAnimation();
mapHandler.initialiseMap();
}
init();