fix re-opening dropdown-menu

This fixes the following case:

1. open the dropdown menu of a "Filename"
2. click elsewhere on the page to close the dropdown menu
   (or click on a submenu element)
3. try to open the same dropdown menu => it fails the first time (since it does not have the "dropdown-menu" class)
This commit is contained in:
Pascal Rigaux 2022-09-16 14:31:32 +02:00 committed by Frédéric Guillot
parent edf31ab20b
commit 829c47ee60
2 changed files with 4 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@ -11,8 +11,6 @@ Kanboard.Dropdown.prototype.listen = function() {
});
$(document).on('click', '.active-dropdown-menu', function() {
$(this).addClass('dropdown-menu');
$(this).removeClass('active-dropdown-menu');
self.close();
});
@ -79,5 +77,7 @@ Kanboard.Dropdown.prototype.close = function() {
KB.trigger('dropdown.beforeDestroy');
}
$('.active-dropdown-menu').addClass('dropdown-menu');
$('.active-dropdown-menu').removeClass('active-dropdown-menu');
$("#dropdown").remove();
};