Permalink
Browse files

Make HeatCanvas.getPath recognize if it's being requested via Rails 3…

… asset pipeline.
  • Loading branch information...
1 parent c3b4822 commit c464625777afd6b55d7de3c0db59a0ef1f17357a @ktopping ktopping committed Mar 8, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 heatcanvas.js
View
@@ -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 "";
}
-

0 comments on commit c464625

Please sign in to comment.