1
0
Fork 0
mirror of https://gitlab.com/SIGBUS/nyaa.git synced 2024-12-22 09:19:59 +00:00

Merge pull request #221 from CounterPillow/focus-report-field

Focus report reason text field when reporting
This commit is contained in:
Alex Ingram 2017-06-01 06:30:57 -05:00 committed by GitHub
commit 91a9264442

View file

@ -200,4 +200,20 @@
</div>
</div>
{% endblock %}
<script type="text/javascript">
var target = document.getElementById('torrent-description');
var text = target.innerHTML;
var reader = new commonmark.Parser({safe: true});
var writer = new commonmark.HtmlRenderer({safe: true, softbreak: '<br />'});
var parsed = reader.parse(text.trim());
target.innerHTML = writer.render(parsed);
</script>
<script>
// Focus the report text field once the modal is opened.
$('#reportModal').on('shown.bs.modal', function () {
$('#reason').focus();
})
</script>
{% endblock %}