mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2025-07-20 13:39:07 -04:00
Fixed hightlight file upload on bootstrap5 template
This commit is contained in:
parent
0ce8627561
commit
38955754f3
3 changed files with 30 additions and 2 deletions
|
@ -628,6 +628,17 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|||
baseUri = null;
|
||||
};
|
||||
|
||||
/**
|
||||
* check if bootstrap5 object detected
|
||||
*
|
||||
* @name Helper.isBootstrap5
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
me.isBootstrap5 = function ()
|
||||
{
|
||||
return typeof bootstrap !== 'undefined';
|
||||
};
|
||||
|
||||
return me;
|
||||
})();
|
||||
|
||||
|
@ -4632,7 +4643,11 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|||
// visually indicate file uploaded
|
||||
const $attachDropdownToggle = $attach.children('.dropdown-toggle');
|
||||
if ($attachDropdownToggle.attr('aria-expanded') === 'false') {
|
||||
$attachDropdownToggle.click();
|
||||
if (Helper.isBootstrap5()) {
|
||||
new bootstrap.Dropdown($attachDropdownToggle).toggle();
|
||||
} else {
|
||||
$attachDropdownToggle.click();
|
||||
}
|
||||
}
|
||||
$fileWrap.addClass('highlight');
|
||||
setTimeout(function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue