summaryrefslogtreecommitdiff
path: root/js/backoffice.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/backoffice.js')
-rw-r--r--js/backoffice.js22
1 files changed, 13 insertions, 9 deletions
diff --git a/js/backoffice.js b/js/backoffice.js
index 1c1b1fa..c5524e1 100644
--- a/js/backoffice.js
+++ b/js/backoffice.js
@@ -57,6 +57,7 @@ function close_popup(){
toggle_overlay(true);
}
+module.exports.close_popup = close_popup;
function amount_sum(a1, a2){
if(a1.currency != a2.currency)
@@ -129,14 +130,11 @@ function track_transfer(exchange, wtid){
case 200:
var tracks = JSON.parse(req.responseText);
clean_results();
+ /**
+ * close the popup which is now on the focus showing
+ * the tracks from one order. */
close_popup();
- fill_table(tracks.deposits_sums, tracks.execution_time);
-
- // draw a line @ the bottom, mentioning the WTID.
- var table = document.getElementById("history");
- var tbody = xpath_get("tbody", table).snapshotItem(0);
- var marker = make_marker(wtid);
- tbody.appendChild(marker);
+ fill_table(tracks.deposits_sums, tracks.execution_time, wtid);
break;
case 400:
console.log("Bad request, check submitted data!");
@@ -148,6 +146,7 @@ function track_transfer(exchange, wtid){
}
req.send();
}
+module.exports.track_transfer = track_transfer;
function track_order(order_id){
var req = new XMLHttpRequest();
@@ -219,7 +218,7 @@ function xpath_get(xpath, ctx){
/**
* Append results to the table showing results.
*/
-function fill_table(history, execution_time){
+function fill_table(history, execution_time, wtid_marker){
var table = document.getElementById("history");
var tbody = xpath_get("tbody", table).snapshotItem(0);
var nr = xpath_get("tr[@class='no-records']", tbody).snapshotItem(0)
@@ -265,7 +264,11 @@ function fill_table(history, execution_time){
tbody.appendChild(row);
tbody.appendChild(row_summary);
}
-
+ if (wtid_marker){
+ // draw a line @ the bottom, mentioning the WTID.
+ var marker = make_marker(wtid_marker);
+ tbody.appendChild(marker);
+ }
function remove_loader(){
var loader = document.getElementsByClassName("loader")[0];
loader.style.visibility = "hidden";
@@ -273,6 +276,7 @@ function fill_table(history, execution_time){
}
window.setTimeout(remove_loader, 900);
}
+module.exports.fill_table = fill_table;
/**
* Issue a direrct /track via Web form.