diff --git a/src/core_plugins/kibana/public/context/app.html b/src/core_plugins/kibana/public/context/app.html index 6d0235435e7bf..6d7a870cefbb1 100644 --- a/src/core_plugins/kibana/public/context/app.html +++ b/src/core_plugins/kibana/public/context/app.html @@ -118,6 +118,7 @@ sorting="contextApp.state.queryParameters.sort" columns="contextApp.state.queryParameters.columns" infinite-scroll="true" + minimum-visible-rows="contextApp.state.rows.all.length" > diff --git a/src/core_plugins/kibana/public/discover/controllers/discover.js b/src/core_plugins/kibana/public/discover/controllers/discover.js index 9a710e48d9d45..73c8bf9f31e0a 100644 --- a/src/core_plugins/kibana/public/discover/controllers/discover.js +++ b/src/core_plugins/kibana/public/discover/controllers/discover.js @@ -89,8 +89,21 @@ app.directive('discoverApp', function () { }; }); -function discoverController($scope, config, courier, $route, $window, Notifier, - AppState, timefilter, Promise, Private, kbnUrl) { +function discoverController( + $element, + $route, + $scope, + $timeout, + $window, + AppState, + Notifier, + Private, + Promise, + config, + courier, + kbnUrl, + timefilter, +) { const Vis = Private(VisProvider); const docTitle = Private(DocTitleProvider); @@ -106,6 +119,7 @@ function discoverController($scope, config, courier, $route, $window, Notifier, $scope.queryDocLinks = documentationLinks.query; $scope.intervalOptions = Private(AggTypesBucketsIntervalOptionsProvider); $scope.showInterval = false; + $scope.minimumVisibleRows = 50; $scope.intervalEnabled = function (interval) { return interval.val !== 'custom'; @@ -575,10 +589,21 @@ function discoverController($scope, config, courier, $route, $window, Notifier, columnActions.moveColumn($scope.state.columns, columnName, newIndex); }; - $scope.toTop = function () { + $scope.scrollToTop = function () { $window.scrollTo(0, 0); }; + $scope.scrollToBottom = function () { + // delay scrolling to after the rows have been rendered + $timeout(() => { + $element.find('#discoverBottomMarker').focus(); + }, 0); + }; + + $scope.showAllRows = function () { + $scope.minimumVisibleRows = $scope.hits; + }; + let loadingVis; function setupVisualization() { // If we're not setting anything up we need to return an empty promise diff --git a/src/core_plugins/kibana/public/discover/index.html b/src/core_plugins/kibana/public/discover/index.html index 5ea49c5bd05ec..1a37a75914157 100644 --- a/src/core_plugins/kibana/public/discover/index.html +++ b/src/core_plugins/kibana/public/discover/index.html @@ -101,6 +101,16 @@