flyover.js: Close left flyovers more efficiently

This commit is contained in:
Johannes Meyer 2022-03-07 13:38:23 +01:00
parent 699d2534fa
commit 6cd1e512f9
1 changed files with 3 additions and 4 deletions

View File

@ -40,14 +40,13 @@
};
Flyover.prototype.onClick = function(event) {
// Close flyover on click outside the flyover
var $target = $(event.target);
if (! $target.closest('.flyover').length) {
var _this = event.data.self;
$target.closest('#main').find('.flyover.flyover-expanded').each(function() {
$(this).find('.flyover-toggle:first').each(function() {
_this.onClickFlyoverToggle({target: this});
});
$.each(expandedFlyovers, function (id) {
_this.onClickFlyoverToggle({target: $('.flyover-toggle', id)[0]});
});
}
};