only mention the path, and ternery
This commit is contained in:
parent
c3cb132463
commit
f26da9f9be
@ -37,18 +37,15 @@ L.Icon.Default.imagePath = (function () {
|
||||
var scripts = document.getElementsByTagName('script'),
|
||||
leafletRe = /\/?leaflet[\-\._]?([\w\-\._]*)\.js\??/;
|
||||
|
||||
var i, len, src, matches;
|
||||
var i, len, src, matches, path;
|
||||
|
||||
for (i = 0, len = scripts.length; i < len; i++) {
|
||||
src = scripts[i].src;
|
||||
matches = src.match(leafletRe);
|
||||
|
||||
if (matches) {
|
||||
if (src.split(leafletRe)[0]) {
|
||||
return src.split(leafletRe)[0] + '/images';
|
||||
} else {
|
||||
return 'images';
|
||||
}
|
||||
path = src.split(leafletRe)[0];
|
||||
return (path ? path + '/' : '') + 'images';
|
||||
}
|
||||
}
|
||||
}());
|
||||
|
Loading…
Reference in New Issue
Block a user