chore: update build

This commit is contained in:
Shivam Mishra 2020-06-30 22:10:53 +05:30
parent a02c79c73c
commit d6c33a1e36
9 changed files with 19 additions and 8 deletions

View File

@ -46,6 +46,13 @@ function getOffset(element) {
};
}
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetParent
// an element's offsetParent property will return null whenever it, or any of its parents,
// is hidden via the display style property.
function isHidden(el) {
return (el.offsetParent === null);
}
function isElementInViewport(el) {
// Although straightforward: https://stackoverflow.com/a/7557433/6495043
var rect = el.getBoundingClientRect();
@ -1593,6 +1600,10 @@ class BaseChart {
bindTooltip() {}
draw(onlyWidthChange=false, init=false) {
if (onlyWidthChange && isHidden(this.parent)) {
// Don't update anything if the chart is hidden
return;
}
this.updateWidth();
this.calc(onlyWidthChange);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long