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; };