From 39ded1e88f22395a1fba6c757e3b901b547d8e12 Mon Sep 17 00:00:00 2001 From: kbasten Date: Sun, 1 Jul 2018 12:30:21 +0200 Subject: [PATCH] Fix visibility of scale lines after toggling left axis groups (#3936) --- lib/timeline/component/DataAxis.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/timeline/component/DataAxis.js b/lib/timeline/component/DataAxis.js index 8ad33eb2..8f3ee8bd 100644 --- a/lib/timeline/component/DataAxis.js +++ b/lib/timeline/component/DataAxis.js @@ -163,6 +163,8 @@ DataAxis.prototype._create = function () { this.dom.lineContainer.style.width = '100%'; this.dom.lineContainer.style.height = this.height; this.dom.lineContainer.style.position = 'relative'; + this.dom.lineContainer.style.visibility = 'visible'; + this.dom.lineContainer.style.display = 'block'; // create svg element for graph drawing. this.svg = document.createElementNS('http://www.w3.org/2000/svg', "svg"); @@ -213,7 +215,7 @@ DataAxis.prototype._cleanupIcons = function () { DOMutil.cleanupElements(this.svgElements); this.iconsRemoved = true; } -} +}; /** * Create the HTML DOM for the DataAxis @@ -232,6 +234,7 @@ DataAxis.prototype.show = function () { if (!this.dom.lineContainer.parentNode) { this.body.dom.backgroundHorizontal.appendChild(this.dom.lineContainer); } + this.dom.lineContainer.style.display = 'block'; }; /** @@ -243,9 +246,7 @@ DataAxis.prototype.hide = function () { this.dom.frame.parentNode.removeChild(this.dom.frame); } - if (this.dom.lineContainer.parentNode) { - this.dom.lineContainer.parentNode.removeChild(this.dom.lineContainer); - } + this.dom.lineContainer.style.display = 'none'; }; /** @@ -382,6 +383,9 @@ DataAxis.prototype._redrawLabels = function () { if (this.master === false && this.masterAxis != undefined) { this.scale.followScale(this.masterAxis.scale); + this.dom.lineContainer.style.display = 'none'; + } else{ + this.dom.lineContainer.style.display = 'block'; } //Is updated in side-effect of _redrawLabel():