Replace deprecated String.prototype.substr()
String.prototype.substr() is deprecated (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr) so we replace it with slice() which works similarily but isn't deprecated. Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
This commit is contained in:
parent
fbd45a2ea0
commit
be878df097
3 changed files with 4 additions and 4 deletions
|
@ -12,7 +12,7 @@ window.onload = function () {
|
|||
I18n.locale = navigator.language;
|
||||
}
|
||||
|
||||
var query = (window.location.search || '?').substr(1),
|
||||
var query = (window.location.search || '?').slice(1),
|
||||
args = {};
|
||||
|
||||
var pairs = query.split('&');
|
||||
|
|
|
@ -103,8 +103,8 @@ OSM.Query = function (map) {
|
|||
value = tags[key];
|
||||
|
||||
if (prefixes[key]) {
|
||||
var first = value.substr(0, 1).toUpperCase(),
|
||||
rest = value.substr(1).replace(/_/g, " ");
|
||||
var first = value.slice(0, 1).toUpperCase(),
|
||||
rest = value.slice(1).replace(/_/g, " ");
|
||||
|
||||
return first + rest;
|
||||
}
|
||||
|
|
|
@ -146,7 +146,7 @@ OSM = {
|
|||
return args;
|
||||
}
|
||||
|
||||
hash = Qs.parse(hash.substr(i + 1));
|
||||
hash = Qs.parse(hash.slice(i + 1));
|
||||
|
||||
var map = (hash.map || '').split('/'),
|
||||
zoom = parseInt(map[0], 10),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue