1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-23 13:04:23 +00:00

Merge pull request #12916 from mr-cn/master

WebUI: Fix wrong file renaming selection range
This commit is contained in:
Mike Tzou 2020-05-26 22:15:28 +08:00 committed by GitHub
commit 446d308bf0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,7 +38,7 @@
const decodedName = decodeURIComponent(name); const decodedName = decodeURIComponent(name);
$('rename').value = decodedName; $('rename').value = decodedName;
$('rename').focus(); $('rename').focus();
$('rename').setSelectionRange(0, decodedName.indexOf('.')); $('rename').setSelectionRange(0, decodedName.lastIndexOf('.'));
$('renameButton').addEvent('click', function(e) { $('renameButton').addEvent('click', function(e) {
new Event(e).stop(); new Event(e).stop();