From 545ba7506efb8e3bdf2cae39f82d1f8835b9d048 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Sun, 21 Apr 2024 11:01:40 +0200 Subject: [PATCH] bootstrap 5 - fix password modal display --- js/privatebin.js | 6 +++++- tpl/bootstrap.php | 2 +- tpl/bootstrap5.php | 4 ++-- tpl/page.php | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/js/privatebin.js b/js/privatebin.js index f05afa79..e48ccbcb 100644 --- a/js/privatebin.js +++ b/js/privatebin.js @@ -2305,6 +2305,7 @@ jQuery.PrivateBin = (function($, RawDeflate) { backdrop: 'static', keyboard: false }); + $passwordModal.modal('show'); // focus password input $passwordDecrypt.focus(); // then re-focus it, when modal causes it to loose focus again @@ -3926,7 +3927,10 @@ jQuery.PrivateBin = (function($, RawDeflate) { text: window.location.href }); $('#qrcode-display').html(qrCanvas); - $('#qrcodemodal').modal('show'); + // only necessary for bootstrap 5, other templates won't have this + if (bootstrap.Tooltip.VERSION) { + $('#qrcodemodal').modal('show'); + } } /** diff --git a/tpl/bootstrap.php b/tpl/bootstrap.php index 23a06a48..3ea05f43 100644 --- a/tpl/bootstrap.php +++ b/tpl/bootstrap.php @@ -73,7 +73,7 @@ endif; ?> - + diff --git a/tpl/bootstrap5.php b/tpl/bootstrap5.php index 7857edd7..79f31aa8 100644 --- a/tpl/bootstrap5.php +++ b/tpl/bootstrap5.php @@ -57,7 +57,7 @@ endif; ?> - + @@ -86,7 +86,7 @@ endif;