Autofocus inputs, handle Enter key after entering decryption password

This commit is contained in:
Gavin Troy 2023-02-19 20:03:52 +00:00
parent 01c96357ea
commit 690d70bc7a
2 changed files with 10 additions and 1 deletions

View file

@ -134,6 +134,15 @@ $(document).ready(function() {
$('#burn-dropdown-btn').text("Burn: " + this.innerHTML);
});
$('#password-modal').on('shown.bs.modal', function () {
$('#modal-password').trigger('focus');
})
$('#password-modal form').submit(function(event) {
event.preventDefault();
$('#decrypt-btn').click();
});
$('#decrypt-btn').click(function(event) {
var pass = $("#modal-password").val();
var data = "";

View file

@ -254,7 +254,7 @@
{{#if is_editable}}
<div class="form-group">
<textarea class="form-control" id="content-textarea" rows="25">{{pastebin_code}}</textarea>
<textarea autofocus class="form-control" id="content-textarea" rows="25">{{pastebin_code}}</textarea>
</div>
{{/if}}
{{#if is_created or is_clone}}