Make flyover responsive
This commit is contained in:
parent
c786cb9b7e
commit
bc4b9fb4e0
|
@ -277,7 +277,17 @@ ul.tree li a.error:hover {
|
|||
width: 1em;
|
||||
|
||||
position: absolute;
|
||||
left: 4px;
|
||||
left: 6px;
|
||||
top: -7px;
|
||||
}
|
||||
|
||||
&.flyover-right .flyover-content {
|
||||
left: auto;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
&.flyover-arrow-top.flyover-right .flyover-content:before {
|
||||
left: auto;
|
||||
right: 6px;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,6 +28,12 @@
|
|||
var $this = $(this);
|
||||
|
||||
if (typeof expandedFlyovers['#' + $this.attr('id')] !== 'undefined') {
|
||||
var $container = $this.closest('.container');
|
||||
|
||||
if ($this.offset().left - $container.offset().left > $container.innerWidth() / 2) {
|
||||
$this.addClass('flyover-right');
|
||||
}
|
||||
|
||||
$this.toggleClass('flyover-expanded');
|
||||
}
|
||||
});
|
||||
|
@ -50,8 +56,16 @@
|
|||
$flyover.toggleClass('flyover-expanded');
|
||||
|
||||
if ($flyover.hasClass('flyover-expanded')) {
|
||||
var $container = $flyover.closest('.container');
|
||||
|
||||
if ($flyover.offset().left - $container.offset().left > $container.innerWidth() / 2) {
|
||||
$flyover.addClass('flyover-right');
|
||||
}
|
||||
|
||||
expandedFlyovers['#' + $flyover.attr('id')] = null;
|
||||
} else {
|
||||
$flyover.removeClass('flyover-right');
|
||||
|
||||
delete expandedFlyovers['#' + $flyover.attr('id')];
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue