Merge pull request #4693 from Icinga/allow-flyovers-to-suspend-auto-refreshes
Allow flyovers to suspend auto refreshes
This commit is contained in:
commit
26d8b2a051
|
@ -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]});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
@ -57,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')];
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue