Skip to content

Commit

Permalink
Merge pull request #20 from ktopping/master
Browse files Browse the repository at this point in the history
HeatCanvas.getPath() wasn't working when heatcanvas.js was requested via Rails asset pipeline
  • Loading branch information
sunng87 committed Mar 12, 2013
2 parents c3b4822 + c464625 commit d6ec77d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions heatcanvas.js
Expand Up @@ -193,11 +193,11 @@ HeatCanvas.getPath = function() {
var scriptTags = document.getElementsByTagName("script"); var scriptTags = document.getElementsByTagName("script");
for (var i=0; i<scriptTags.length; i++) { for (var i=0; i<scriptTags.length; i++) {
var src = scriptTags[i].src; 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) { if (pos > 0) {
return src.substring(0, pos); return src.substring(0, pos);
} }
} }
return ""; return "";
} }

0 comments on commit d6ec77d

Please sign in to comment.