mirror of
https://gitlab.com/SIGBUS/nyaa.git
synced 2024-12-22 20:29:59 +00:00
Merge pull request #221 from CounterPillow/focus-report-field
Focus report reason text field when reporting
This commit is contained in:
commit
91a9264442
|
@ -200,4 +200,20 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<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 %}
|
{% endblock %}
|
Loading…
Reference in a new issue