Commit d5286781 authored by Masayuki Tanaka's avatar Masayuki Tanaka

Fix resize when multiple charts exist - #17

parent cd50426a
......@@ -1519,7 +1519,10 @@
// Bind resize event
if (window.onresize == null) {
window.onresize = resize;
window.onresize = generateResize();
}
if (window.onresize.add) {
window.onresize.add(resize);
}
}
......@@ -2083,6 +2086,18 @@
}
}
function generateResize() {
var resizeFunctions = [];
function callResizeFunctions() {
resizeFunctions.forEach(function (f) {
f();
});
}
callResizeFunctions.add = function (f) {
resizeFunctions.push(f);
};
return callResizeFunctions;
}
function resize() {
// Update sizes and scales
updateSizes();
......
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