cms/app-client/app/components/discourses-component.js
changeset 466 a8effb60ccb6
parent 465 9df336529b2f
child 467 762fc0eb4946
--- a/cms/app-client/app/components/discourses-component.js	Sun Dec 04 00:23:52 2016 +0100
+++ b/cms/app-client/app/components/discourses-component.js	Sun Dec 04 13:49:44 2016 +0100
@@ -20,6 +20,7 @@
     }).on('init'),
 
     didRender: function() {
+        var previousDiv = d3.selectAll(".discourses");
         var self = this;
 
         var discourses = this.get('discourses');
@@ -42,7 +43,11 @@
             })
             .padding(10);
 
-        var element = d3.select('#' + self.get('elementId'));
+        var element = d3.select('#' + self.get('elementId'))
+          .append('div')
+          .attr('class','discourses')
+          .style('position','absolute')
+          .style('left', -100000);
 
         var bubbles = bubble.nodes(self.createNodes());
 
@@ -71,6 +76,9 @@
             .style("margin-left", function() { return ( Ember.$(this).width() > Ember.$(this).parent().width() ? - ( Ember.$(this).width() / 2 ) + ( Ember.$(this).parent().width() / 2 ) : 0 ) + 'px'; })
             .style("margin-top", function() { return Ember.$(this).parent().height() / 2 - Ember.$(this).height() / 2 + 'px'; });
 
+        previousDiv.remove();
+        element.style('position',null).style('left',null);
+
         this._super(...arguments);
     },