Commit 090c9405 authored by Mike Greiling's avatar Mike Greiling

rename resize and animate methods for clarity

parent 2e40f0bd
......@@ -204,7 +204,7 @@ export default class BurndownChart {
}
// reset width and height to match the svg element, then re-render if necessary
resize() {
handleResize() {
const dimensions = this.canvas.node().getBoundingClientRect();
if (this.width !== dimensions.width || this.height !== dimensions.height) {
this.width = dimensions.width;
......@@ -320,7 +320,7 @@ export default class BurndownChart {
this.queuedRender = this.queuedRender || requestAnimationFrame(() => this.render());
}
animate(seconds = 5) {
animateResize(seconds = 5) {
this.ticksLeft = this.ticksLeft || 0;
if (this.ticksLeft <= 0) {
const interval = setInterval(() => {
......@@ -328,7 +328,7 @@ export default class BurndownChart {
if (this.ticksLeft <= 0) {
clearInterval(interval);
}
this.resize();
this.handleResize();
}, 20);
}
this.ticksLeft = seconds * 50;
......
......@@ -18,6 +18,6 @@ $(() => {
});
chart.setData(testData);
window.addEventListener('resize', () => chart.animate(1));
$(document).on('click', '.js-sidebar-toggle', () => chart.animate(2));
window.addEventListener('resize', () => chart.animateResize(1));
$(document).on('click', '.js-sidebar-toggle', () => chart.animateResize(2));
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment