Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #20 from ktopping/master

HeatCanvas.getPath() wasn't working when heatcanvas.js was requested via Rails asset pipeline
  • Loading branch information...
commit d6ec77d1579d539fe319f6b4675b2ea9a4a030b0 2 parents c3b4822 + c464625
@sunng87 authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 heatcanvas.js
View
4 heatcanvas.js
@@ -193,11 +193,11 @@ HeatCanvas.getPath = function() {
var scriptTags = document.getElementsByTagName("script");
for (var i=0; i<scriptTags.length; i++) {
var src = scriptTags[i].src;
- var pos = src.indexOf("heatcanvas.js");
+ var match = src.match(/heatcanvas(-[a-z0-9]{32})?\.js/);
+ var pos = match ? match.index : 0;
if (pos > 0) {
return src.substring(0, pos);
}
}
return "";
}
-
Please sign in to comment.
Something went wrong with that request. Please try again.