Skip to content

Commit d6c33a1

Browse files
committed
chore: update build
1 parent a02c79c commit d6c33a1

9 files changed

+19
-8
lines changed

dist/frappe-charts.esm.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ function getOffset(element) {
4646
};
4747
}
4848

49+
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetParent
50+
// an element's offsetParent property will return null whenever it, or any of its parents,
51+
// is hidden via the display style property.
52+
function isHidden(el) {
53+
return (el.offsetParent === null);
54+
}
55+
4956
function isElementInViewport(el) {
5057
// Although straightforward: https://stackoverflow.com/a/7557433/6495043
5158
var rect = el.getBoundingClientRect();
@@ -1593,6 +1600,10 @@ class BaseChart {
15931600
bindTooltip() {}
15941601

15951602
draw(onlyWidthChange=false, init=false) {
1603+
if (onlyWidthChange && isHidden(this.parent)) {
1604+
// Don't update anything if the chart is hidden
1605+
return;
1606+
}
15961607
this.updateWidth();
15971608

15981609
this.calc(onlyWidthChange);

dist/frappe-charts.min.cjs.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/frappe-charts.min.cjs.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/frappe-charts.min.esm.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/frappe-charts.min.esm.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/frappe-charts.min.iife.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/frappe-charts.min.iife.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/assets/js/frappe-charts.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/assets/js/frappe-charts.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)