Skip to content

Commit

Permalink
Check for raphael.safari() before using it
Browse files Browse the repository at this point in the history
The function `Raphael.safari()` seems to be removed from newer version of Raphael. Hence this fix to check for the function presence before using it.
See issue DmitryBaranovskiy/raphael#980 and comment from tomasAlabes:
```
R.safari is not part of raphael anymore [...]
```
  • Loading branch information
Indigo744 committed Oct 28, 2015
1 parent 29aacb4 commit f458ea8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions js/jquery.mapael.js
Expand Up @@ -1160,7 +1160,10 @@
$.fn.mapael.elemHover = function (paper, mapElem, textElem) {
mapElem.animate(mapElem.attrsHover, mapElem.attrsHover.animDuration);
textElem && textElem.animate(textElem.attrsHover, textElem.attrsHover.animDuration);
paper.safari();
// workaround for older version of Raphael
if (typeof paper.safari === "function") {
paper.safari();
}
};

/**
Expand All @@ -1172,7 +1175,10 @@
$.fn.mapael.elemOut = function (paper, mapElem, textElem) {
mapElem.animate(mapElem.originalAttrs, mapElem.attrsHover.animDuration);
textElem && textElem.animate(textElem.originalAttrs, textElem.attrsHover.animDuration);
paper.safari();
// workaround for older version of Raphael
if (typeof paper.safari === "function") {
paper.safari();
}
};

/**
Expand Down

0 comments on commit f458ea8

Please sign in to comment.