From 4d68f5c3542832dd330785c13cd5c169b687ec23 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 7 Mar 2022 13:38:54 +0100 Subject: [PATCH] flyover.js: Suspend autofresh while open if enabled --- public/js/icinga/behavior/flyover.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/public/js/icinga/behavior/flyover.js b/public/js/icinga/behavior/flyover.js index 68e1b4225..207d57780 100644 --- a/public/js/icinga/behavior/flyover.js +++ b/public/js/icinga/behavior/flyover.js @@ -56,17 +56,24 @@ $flyover.toggleClass('flyover-expanded'); + var $container = $flyover.closest('.container'); if ($flyover.hasClass('flyover-expanded')) { - var $container = $flyover.closest('.container'); - if ($flyover.offset().left - $container.offset().left > $container.innerWidth() / 2) { $flyover.addClass('flyover-right'); } + if ($flyover.is('[data-flyover-suspends-auto-refresh]')) { + $container[0].dataset.suspendAutorefresh = ''; + } + expandedFlyovers['#' + $flyover.attr('id')] = null; } else { $flyover.removeClass('flyover-right'); + if ($flyover.is('[data-flyover-suspends-auto-refresh]')) { + delete $container[0].dataset.suspendAutorefresh; + } + delete expandedFlyovers['#' + $flyover.attr('id')]; } };