From dc0b2af59dc76cab9b2382476cf902b6ecfd50d9 Mon Sep 17 00:00:00 2001 From: sgiehl Date: Fri, 4 Jan 2013 23:26:50 +0000 Subject: fixed js error in annotations if no graph available git-svn-id: http://dev.piwik.org/svn/trunk@7735 59fd770c-687e-43c8-a1e3-f5a4ff64c105 --- plugins/Annotations/templates/annotations.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'plugins/Annotations/templates') diff --git a/plugins/Annotations/templates/annotations.js b/plugins/Annotations/templates/annotations.js index f04847ef5b..0c6975f011 100755 --- a/plugins/Annotations/templates/annotations.js +++ b/plugins/Annotations/templates/annotations.js @@ -600,6 +600,12 @@ var placeEvolutionIcons = function (annotations, graphElem) var canvases = $('.piwik-graph .jqplot-xaxis canvas', graphElem), noteSize = 16; + // if no graph available, hide all icons + if (!canvases || canvases.length == 0) { + $('span', annotations).hide(); + return true; + } + // set position of each individual icon $('span', annotations).each(function(i) { var canvas = $(canvases[i]), -- cgit v1.2.3