Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

Commit

Permalink
Merge pull request #30 from peller/IronResize
Browse files Browse the repository at this point in the history
  • Loading branch information
lbustelo committed Oct 9, 2015
2 parents 54956d4 + d3f5662 commit 4723574
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions elements/urth-viz-chart/urth-viz-chart.html
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,14 @@
}
},

behaviors: [
Polymer.IronResizableBehavior
],

listeners: {
'iron-resize': '_resizer'
},

_svgSelection: function(d3) {
return d3.select(this.$.chart1).select('svg');
},
Expand Down Expand Up @@ -361,19 +369,10 @@
});
},

_resizer: function() { //FIXME: debounce?
_resizer: function() {
if (this.chart) {
this.chart.update();
}
},

attached: function() {
this._resizer = this._resizer.bind(this);
window.addEventListener('resize', this._resizer);
},

detached: function() {
window.removeEventListener('resize', this._resizer);
}
});

Expand Down

0 comments on commit 4723574

Please sign in to comment.