Replace string.contains() with string.indexOf() which is better supported.

This commit is contained in:
Sascha L. Teichmann 2015-03-13 16:25:19 +01:00
parent b54b2b6b91
commit f71db790e7
2 changed files with 2 additions and 2 deletions

View File

@ -136,7 +136,7 @@ manualUpdateControl = L.easyButton('fa-refresh',
for (var i = 0; i < tiles.length; i++) { for (var i = 0; i < tiles.length; i++) {
var img = tiles[i]; var img = tiles[i];
var cl = img.getAttribute("class"); var cl = img.getAttribute("class");
if (cl.contains("leaflet-tile-loaded")) { if (cl.indexOf("leaflet-tile-loaded") >= 0) {
var src = img.src; var src = img.src;
var idx = src.lastIndexOf("#"); var idx = src.lastIndexOf("#");
if (idx >= 0) { if (idx >= 0) {

View File

@ -137,7 +137,7 @@ L.Control.AutoUpdate = L.Control.extend({
for (var i = 0; i < tiles.length; i++) { for (var i = 0; i < tiles.length; i++) {
var img = tiles[i]; var img = tiles[i];
var cl = img.getAttribute('class'); var cl = img.getAttribute('class');
if (!cl.contains('leaflet-tile-loaded')) { if (cl.indexOf('leaflet-tile-loaded') < 0) {
continue; continue;
} }
var src = img.src; var src = img.src;