Don't search for the element by ID when we already have it

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
This commit is contained in:
Mcat12
2018-04-02 17:43:19 -04:00
parent 5aba5a1314
commit 7244e3a9e0

View File

@@ -36,7 +36,7 @@ var customTooltips = function(tooltip) {
tooltipEl = document.createElement("div");
tooltipEl.id = "chartjs-tooltip";
document.body.appendChild(tooltipEl);
$("#chartjs-tooltip").html("<table></table>");
$(tooltipEl).html("<table></table>");
}
// Hide if no tooltip
if (tooltip.opacity === 0) {
@@ -81,7 +81,7 @@ var customTooltips = function(tooltip) {
innerHtml += "<tr><td>No activity recorded</td></tr>";
}
innerHtml += "</tbody></table>";
$("#chartjs-tooltip").html(innerHtml);
$(tooltipEl).html(innerHtml);
}
// Display, position, and set styles for font