Focus report reason text field when reporting

A small convenience change which by sets the focus to the newly
opened modal dialog's text field if the report button is hit.

This way, people can type away their gripes with the torrent without
having to click into the text field first.
This commit is contained in:
Nicolas F 2017-05-30 19:31:28 +02:00
parent 051f3f38d2
commit 07d45b6223
1 changed files with 8 additions and 1 deletions

View File

@ -216,4 +216,11 @@
target.innerHTML = writer.render(parsed);
</script>
{% endblock %}
<script>
// Focus the report text field once the modal is opened.
$('#reportModal').on('shown.bs.modal', function () {
$('#reason').focus();
})
</script>
{% endblock %}