diff --git a/src/nodejs/public/js/STIXRelationshipGraph.js b/src/nodejs/public/js/STIXRelationshipGraph.js index b3a4ea9..0744a0c 100644 --- a/src/nodejs/public/js/STIXRelationshipGraph.js +++ b/src/nodejs/public/js/STIXRelationshipGraph.js @@ -168,7 +168,7 @@ var StixGraph = function () { configureNav(); // Add graph container element - $('#contentDiv').append($('#graphTemplate').html()); + $('#contentDiv').html($('#graphTemplate').html()); /** * Append svg container for tree diff --git a/src/nodejs/public/js/STIXRelationshipTimeline.js b/src/nodejs/public/js/STIXRelationshipTimeline.js index 95e4e5b..8dadebd 100644 --- a/src/nodejs/public/js/STIXRelationshipTimeline.js +++ b/src/nodejs/public/js/STIXRelationshipTimeline.js @@ -58,28 +58,10 @@ var StixTimeline = function () { _self.resize = function () { - //Function exists to avoid errors but if we actually resize here - //we will get tons of resize events during a drag resize. + drawTimeline(); } - $(window).resize(function () { - waitForFinalEvent(function(){ - drawTimeline(); - }, 500, "some unique string"); - }); - var waitForFinalEvent = (function () { - var timers = {}; - return function (callback, ms, uniqueId) { - if (!uniqueId) { - uniqueId = "Don't call this twice without a uniqueId"; - } - if (timers[uniqueId]) { - clearTimeout (timers[uniqueId]); - } - timers[uniqueId] = setTimeout(callback, ms); - }; - })(); function drawTimeline() { @@ -150,7 +132,7 @@ var StixTimeline = function () { var tooltip = d3.select("body") .append("div") .attr("class", "tooltip") - .style("visibility", "visible"); + .style("visibility", "none"); //-------------------------------------------------------------------------- diff --git a/src/nodejs/public/js/StixViz.js b/src/nodejs/public/js/StixViz.js index 1fc4416..1064041 100644 --- a/src/nodejs/public/js/StixViz.js +++ b/src/nodejs/public/js/StixViz.js @@ -133,10 +133,26 @@ $(function () { /** * When the window is resized, resize and update the tree */ - $(window).resize(function (e) { - view.resize(); - }); + $(window).resize(function () { + waitForFinalEvent(function(){ + view.resize(); + }, 500, "some unique string"); + }); + + var waitForFinalEvent = (function () { + var timers = {}; + return function (callback, ms, uniqueId) { + if (!uniqueId) { + uniqueId = "Don't call this twice without a uniqueId"; + } + if (timers[uniqueId]) { + clearTimeout (timers[uniqueId]); + } + timers[uniqueId] = setTimeout(callback, ms); + }; + })(); + /** * Handler for Show HTML context menu