From db888bd2aad0c0791e788495f20fc210e1c566ea Mon Sep 17 00:00:00 2001 From: yotamberk Date: Sat, 7 Jan 2017 21:45:12 +0200 Subject: [PATCH] Fix #2538 (#2551) * Fix redraw order * Fix error when option is not defined * Allow template labels * Fix #2538 --- lib/timeline/component/TimeAxis.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/timeline/component/TimeAxis.js b/lib/timeline/component/TimeAxis.js index 30f1903b..f575af4b 100644 --- a/lib/timeline/component/TimeAxis.js +++ b/lib/timeline/component/TimeAxis.js @@ -364,14 +364,12 @@ TimeAxis.prototype._repaintMajorText = function (x, text, orientation, className if (!label) { // create label var content = document.createElement('div'); - content.innerHTML = text; label = document.createElement('div'); label.appendChild(content); this.dom.foreground.appendChild(label); } - this.dom.majorTexts.push(label); - label.childNodes[0].nodeValue = text; + label.childNodes[0].innerHTML = text; label.className = 'vis-text vis-major ' + className; //label.title = title; // TODO: this is a heavy operation @@ -383,6 +381,7 @@ TimeAxis.prototype._repaintMajorText = function (x, text, orientation, className label.style.left = x + 'px'; }; + this.dom.majorTexts.push(label); return label; };