From: Dan Vanderkam Date: Thu, 29 Aug 2013 03:32:00 +0000 (-0400) Subject: all tests pass (without compilation) X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=156ce1c7244be1463174bf7c238137de169fd9c0;p=dygraphs.git all tests pass (without compilation) --- diff --git a/plugins/annotations.js b/plugins/annotations.js index 8576104..090f00d 100644 --- a/plugins/annotations.js +++ b/plugins/annotations.js @@ -92,7 +92,7 @@ annotations.prototype.didDrawChart = function(e) { var a = p.annotation; var tick_height = 6; - if (a.hasOwnProperty("tickHeight")) { + if (a.tickHeight) { tick_height = a.tickHeight; } @@ -102,22 +102,22 @@ annotations.prototype.didDrawChart = function(e) { div.style[name] = annotationStyle[name]; } } - if (!a.hasOwnProperty('icon')) { + if (!a.icon) { div.className = "dygraphDefaultAnnotation"; } - if (a.hasOwnProperty('cssClass')) { + if (a.cssClass) { div.className += " " + a.cssClass; } - var width = a.hasOwnProperty('width') ? a.width : 16; - var height = a.hasOwnProperty('height') ? a.height : 16; - if (a.hasOwnProperty('icon')) { + var width = a.width !== undefined ? a.width : 16; + var height = a.height !== undefined ? a.height : 16; + if (a.icon) { var img = document.createElement("img"); img.src = a.icon; img.width = width; img.height = height; div.appendChild(img); - } else if (p.annotation.hasOwnProperty('shortText')) { + } else if (p.annotation.shortText) { div.appendChild(document.createTextNode(p.annotation.shortText)); } var left = p.canvasx - width / 2;