From 25de89c95409805083141678a3e4a1adf4c318f3 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Tue, 6 Feb 2024 20:22:47 +0100 Subject: [PATCH] change loading confirm prefix, fix password modal focus, again --- js/privatebin.js | 16 +++++++--------- tpl/bootstrap.php | 2 +- tpl/page.php | 2 +- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/js/privatebin.js b/js/privatebin.js index 2437e670..073738b7 100644 --- a/js/privatebin.js +++ b/js/privatebin.js @@ -82,7 +82,7 @@ jQuery.PrivateBin = (function($, RawDeflate) { * * @private */ - const loadConfirmPrefix = '#?'; + const loadConfirmPrefix = '#-'; /** * CryptoData class @@ -2303,7 +2303,12 @@ jQuery.PrivateBin = (function($, RawDeflate) { backdrop: 'static', keyboard: false }); + // focus password input $passwordDecrypt.focus(); + // then re-focus it, when modal causes it to loose focus again + setTimeout(function () { + $passwordDecrypt.focus(); + }, 500); return; } @@ -2363,13 +2368,7 @@ jQuery.PrivateBin = (function($, RawDeflate) { $passwordForm = $('#passwordform'); $passwordModal = $('#passwordmodal'); - // bind events - - // focus password input when it is shown - $passwordModal.on('shown.bs.Model', function () { - $passwordDecrypt.focus(); - }); - // handle Model password submission + // bind events - handle Model password submission $passwordForm.submit(submitPasswordModal); }; @@ -3603,7 +3602,6 @@ jQuery.PrivateBin = (function($, RawDeflate) { if (fadeOut === true) { setTimeout(function () { $comment.removeClass('highlight'); - }, 300); } }; diff --git a/tpl/bootstrap.php b/tpl/bootstrap.php index 21c63573..158c0b3a 100644 --- a/tpl/bootstrap.php +++ b/tpl/bootstrap.php @@ -73,7 +73,7 @@ endif; ?> - + diff --git a/tpl/page.php b/tpl/page.php index c3bda2e2..8c15afb0 100644 --- a/tpl/page.php +++ b/tpl/page.php @@ -51,7 +51,7 @@ endif; ?> - +