diff --git a/public/js/icinga/behavior/flyover.js b/public/js/icinga/behavior/flyover.js index 9771c646d..7930d3d08 100644 --- a/public/js/icinga/behavior/flyover.js +++ b/public/js/icinga/behavior/flyover.js @@ -15,7 +15,8 @@ Icinga.EventListener.call(this, icinga); this.on('rendered', this.onRendered, this); - this.on('click', '.flyover-toggle', this.onClick, this); + this.on('click', this.onClick, this); + this.on('click', '.flyover-toggle', this.onClickFlyoverToggle, this); } Flyover.prototype = new Icinga.EventListener(); @@ -33,6 +34,17 @@ }; Flyover.prototype.onClick = function(event) { + var $target = $(event.target); + + if (! $target.closest('.flyover').length) { + var _this = event.data.self; + $target.closest('.container').find('.flyover.flyover-expanded .flyover-toggle').each(function() { + _this.onClickFlyoverToggle({target: this}); + }); + } + }; + + Flyover.prototype.onClickFlyoverToggle = function(event) { var $flyover = $(event.target).closest('.flyover'); $flyover.toggleClass('flyover-expanded');