flyover.js: Suspend autofresh while open if enabled

This commit is contained in:
Johannes Meyer 2022-03-07 13:38:54 +01:00
parent 6cd1e512f9
commit 4d68f5c354
1 changed files with 9 additions and 2 deletions

View File

@ -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')];
}
};