diff options
author | CommanderRoot <CommanderRoot@users.noreply.github.com> | 2022-02-18 07:50:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-18 14:50:36 +0800 |
commit | 1ab88da0e460a076a95dcd2cad812e707da3acc9 (patch) | |
tree | eb685355022b805a9198fe2d9905416f1b1dc8e2 /web_src/js/features/repo-code.js | |
parent | a7b9d44d8842a5a1c82a180215536da647077f68 (diff) | |
download | gitea-1ab88da0e460a076a95dcd2cad812e707da3acc9.tar.gz gitea-1ab88da0e460a076a95dcd2cad812e707da3acc9.zip |
Replace deprecated String.prototype.substr() with String.prototype.slice() (#18796)
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 the slice() method which works similarily but isn't deprecated.
Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'web_src/js/features/repo-code.js')
-rw-r--r-- | web_src/js/features/repo-code.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/web_src/js/features/repo-code.js b/web_src/js/features/repo-code.js index 82ab902ce1..a4b6e433a5 100644 --- a/web_src/js/features/repo-code.js +++ b/web_src/js/features/repo-code.js @@ -36,8 +36,8 @@ function selectRange($list, $select, $from) { }; if ($from) { - let a = parseInt($select.attr('rel').substr(1)); - let b = parseInt($from.attr('rel').substr(1)); + let a = parseInt($select.attr('rel').slice(1)); + let b = parseInt($from.attr('rel').slice(1)); let c; if (a !== b) { if (a > b) { |