From 96b874270fbb4768bba3fabf6cd987afa739559f Mon Sep 17 00:00:00 2001 From: Vincent Broute Date: Tue, 1 Oct 2013 22:23:31 +0200 Subject: [PATCH] 'update' event' now allows to update attrsHover for plots and area (bugfix) --- js/jquery.mapael.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/js/jquery.mapael.js b/js/jquery.mapael.js index 0fc45ced8..d5295e468 100644 --- a/js/jquery.mapael.js +++ b/js/jquery.mapael.js @@ -278,18 +278,22 @@ if (animDuration > 0) { elem.textElem.attr({'text-anchor' : textPosition.textAnchor}); elem.textElem.animate({x : textPosition.x, y : textPosition.y}, animDuration); - } else { + } else elem.textElem.attr({x : textPosition.x, y : textPosition.y, 'text-anchor' : textPosition.textAnchor}); - } } + + $.fn.mapael.setHoverOptions(elem.textElem, elemOptions.text.attrs, elemOptions.text.attrsHover); + if (animDuration > 0) + elem.textElem.animate(elemOptions.text.attrs, animDuration); + else + elem.textElem.attr(elemOptions.text.attrs); } - $.fn.mapael.setHoverOptions(elem.mapElem, elemOptions.attrs, elem.mapElem.attrsHover); - if (animDuration > 0) { + $.fn.mapael.setHoverOptions(elem.mapElem, elemOptions.attrs, elemOptions.attrsHover); + if (animDuration > 0) elem.mapElem.animate(elemOptions.attrs, animDuration); - } else { + else elem.mapElem.attr(elemOptions.attrs); - } if (elemOptions.tooltip && typeof elemOptions.tooltip.content != 'undefined') { if (typeof elem.mapElem.tooltipContent == "undefined") {