From 79627d557904fbf4505419d4cd43bbf7144c0e24 Mon Sep 17 00:00:00 2001 From: Jordan Wright Date: Wed, 24 Feb 2016 17:48:54 -0600 Subject: [PATCH] Fixed caret not being saved. Added realtime updates to timeline --- static/js/app/campaign_results.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/static/js/app/campaign_results.js b/static/js/app/campaign_results.js index 73f794ed..91d14e77 100644 --- a/static/js/app/campaign_results.js +++ b/static/js/app/campaign_results.js @@ -232,18 +232,23 @@ function poll() { /* Update the datatable */ resultsTable = $("#resultsTable").DataTable() resultsTable.rows().every(function(i, tableLoop, rowLoop) { - var rowData = this.row(i).data() + var row = this.row(i) + var rowData = row.data() var rid = rowData[0] $.each(campaign.results, function(j, result) { if (result.id == rid) { var label = statuses[result.status].label || "label-default"; rowData[6] = "" + result.status + "" resultsTable.row(i).data(rowData).draw() + if (row.child.isShown()) { + row.child(renderTimeline(row.data())) + } return false } }) }) /* Update the map information */ + bubbles = [] $.each(campaign.results, function(i, result) { // Check that it wasn't an internal IP if (result.latitude == 0 && result.longitude == 0) { @@ -372,19 +377,20 @@ function load() { $('#resultsTable tbody').on('click', 'td.details-control', function() { var tr = $(this).closest('tr'); var row = resultsTable.row(tr); - if (row.child.isShown()) { // This row is already open - close it row.child.hide(); tr.removeClass('shown'); $(this).find("i").removeClass("fa-caret-down") $(this).find("i").addClass("fa-caret-right") + row.invalidate('dom').draw() } else { // Open this row $(this).find("i").removeClass("fa-caret-right") $(this).find("i").addClass("fa-caret-down") row.child(renderTimeline(row.data())).show(); tr.addClass('shown'); + row.invalidate('dom').draw() } }); // Setup the graphs