on account deletion modal, focus on text input

v1.18.x
Julian Lam 9 years ago
parent 2c6f93efbd
commit 394fa87b39

@ -153,7 +153,7 @@ define('forum/account/edit', ['forum/account/header', 'uploader', 'translator'],
function handleAccountDelete() { function handleAccountDelete() {
$('#deleteAccountBtn').on('click', function() { $('#deleteAccountBtn').on('click', function() {
translator.translate('[[user:delete_account_confirm]]', function(translated) { translator.translate('[[user:delete_account_confirm]]', function(translated) {
bootbox.confirm(translated + '<p><input type="text" class="form-control" id="confirm-username" /></p>', function(confirm) { var modal = bootbox.confirm(translated + '<p><input type="text" class="form-control" id="confirm-username" /></p>', function(confirm) {
if (!confirm) { if (!confirm) {
return; return;
} }
@ -169,6 +169,10 @@ define('forum/account/edit', ['forum/account/header', 'uploader', 'translator'],
}); });
} }
}); });
modal.on('shown.bs.modal', function() {
modal.find('input').focus();
});
}); });
return false; return false;
}); });

Loading…
Cancel
Save