show follow tip on first auto scroll hide

This commit is contained in:
Jake McDermott 2018-08-12 19:35:59 -04:00
parent 91bc39be6b
commit 516607551c
No known key found for this signature in database
GPG Key ID: 9A6F084352C3A0B7
3 changed files with 14 additions and 3 deletions

View File

@ -15,6 +15,7 @@ export const JOB_STATUS_FINISHED = JOB_STATUS_COMPLETE.concat(JOB_STATUS_INCOMPL
export const OUTPUT_ELEMENT_CONTAINER = '.at-Stdout-container';
export const OUTPUT_ELEMENT_TBODY = '#atStdoutResultTable';
export const OUTPUT_ELEMENT_LAST = '#atStdoutMenuLast';
export const OUTPUT_MAX_LAG = 120;
export const OUTPUT_ORDER_BY = 'counter';
export const OUTPUT_PAGE_CACHE = true;

View File

@ -2,6 +2,7 @@
import {
EVENT_START_PLAY,
EVENT_START_TASK,
OUTPUT_ELEMENT_LAST,
OUTPUT_PAGE_SIZE,
} from './constants';
@ -485,6 +486,7 @@ function OutputIndexController (
},
});
let showFollowTip = true;
const rates = [];
stream.init({
bufferAdd,
@ -494,12 +496,19 @@ function OutputIndexController (
rates.push(rate);
rates.splice(0, rates.length - 5);
if (rates.every(value => value === 1)) {
scroll.unlock();
scroll.unhide();
}
if (rate > 1 && vm.isFollowing) {
scroll.lock();
scroll.hide();
} else if (rates.every(value => value === 1)) {
scroll.unlock();
scroll.unhide();
if (showFollowTip) {
showFollowTip = false;
$(OUTPUT_ELEMENT_LAST).trigger('mouseenter');
}
}
},
onStop () {

View File

@ -28,6 +28,7 @@
<div class="pull-right" ng-click="vm.menu.last()">
<i class="at-Stdout-menuIcon--lg fa fa-angle-double-down"
ng-class="{ 'at-Stdout-menuIcon--active': vm.isFollowing }"
id="atStdoutMenuLast"
data-placement="top"
data-trigger="hover"
data-tip-watch="vm.followTooltip"