1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +03:00

fix line anchoring of expand and collapse all

This commit is contained in:
John Mitchell 2016-12-14 15:25:34 -05:00
parent 0c7421460c
commit 85264cb01a

View File

@ -90,23 +90,14 @@ export default [ 'templateUrl', '$timeout', '$location', '$anchorScroll',
var visItem,
parentItem;
var containerHeight = $container.height();
var containerTop = $container.position().top;
var containerNetHeight = containerHeight + containerTop;
// iterate through each line of standard out
$container.find('.JobResultsStdOut-aLineOfStdOut')
$container.find('.JobResultsStdOut-aLineOfStdOut:visible')
.each( function () {
var $this = $(this);
var lineHeight = $this.height();
var lineTop = $this.position().top;
var lineNetHeight = lineHeight + lineTop;
// check to see if the line is the first visible
// line in the viewport...
if (lineNetHeight > containerTop &&
lineTop < containerNetHeight) {
if ($this.position().top >= 0) {
// ...if it is, return the line number
// for this line