From 6cd1e512f9c7ba57379ed1ff4613adcc1e58e887 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 7 Mar 2022 13:38:23 +0100 Subject: [PATCH] flyover.js: Close left flyovers more efficiently --- public/js/icinga/behavior/flyover.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/public/js/icinga/behavior/flyover.js b/public/js/icinga/behavior/flyover.js index 931b300bc..68e1b4225 100644 --- a/public/js/icinga/behavior/flyover.js +++ b/public/js/icinga/behavior/flyover.js @@ -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]}); }); } };