Skip to content

Commit

Permalink
Fix dategraph not updating if you change the date restrictions while …
Browse files Browse the repository at this point in the history
…it's not active
  • Loading branch information
tung-jin-chew-hp committed Mar 9, 2017
1 parent 3e1c012 commit 16a71f7
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ define([
},

update: function() {
if(this.$el.is(':visible')) {
this.updateGraph();
}
},

updateGraph: function() {
Expand Down Expand Up @@ -188,7 +191,10 @@ define([
},

fetchBuckets: function() {
var width = this.$('.dategraph-content').width();
// We now use the width of the closest visible ancestor, even if this tab itself is currently hidden,
// since the filters may change when we're not looking at the screen; which gives zero width for
// the SVG if it's not on the screen, but we still need data.
var width = this.$('.dategraph-content').closest(':visible').width();

// If the SVG has no width or there are no values, there is no point fetching new data
// if(width !== 0 && this.model.get('totalValues') !== 0) {
Expand Down

0 comments on commit 16a71f7

Please sign in to comment.