flyover.js: Close left flyovers more efficiently
This commit is contained in:
parent
699d2534fa
commit
6cd1e512f9
|
@ -40,14 +40,13 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
Flyover.prototype.onClick = function(event) {
|
Flyover.prototype.onClick = function(event) {
|
||||||
|
// Close flyover on click outside the flyover
|
||||||
var $target = $(event.target);
|
var $target = $(event.target);
|
||||||
|
|
||||||
if (! $target.closest('.flyover').length) {
|
if (! $target.closest('.flyover').length) {
|
||||||
var _this = event.data.self;
|
var _this = event.data.self;
|
||||||
$target.closest('#main').find('.flyover.flyover-expanded').each(function() {
|
$.each(expandedFlyovers, function (id) {
|
||||||
$(this).find('.flyover-toggle:first').each(function() {
|
_this.onClickFlyoverToggle({target: $('.flyover-toggle', id)[0]});
|
||||||
_this.onClickFlyoverToggle({target: this});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue