Skip to content

Commit

Permalink
Merge pull request #6128 from rashidkpc/tweak/saved-object-list-length
Browse files Browse the repository at this point in the history
Make saved object list length configurable
  • Loading branch information
Rashid Khan committed Feb 8, 2016
2 parents 5aab99f + 956adbd commit 94a9e65
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/ui/public/config/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@ define(function (require) {
value: '($0,0.[00])',
description: 'Default <a href="http://numeraljs.com/" target="_blank">numeral format</a> for the "currency" format'
},
'savedObjects:perPage': {
type: 'number',
value: 5,
description: 'Number of objects to show per page in the load dialog'
},
'timepicker:timeDefaults': {
type: 'json',
value: [
Expand Down
5 changes: 4 additions & 1 deletion src/ui/public/directives/saved_object_finder.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import keymap from 'ui/utils/key_map';
define(function (require) {
var module = require('ui/modules').get('kibana');

module.directive('savedObjectFinder', function ($location, $injector, kbnUrl, Private) {
module.directive('savedObjectFinder', function ($location, $injector, kbnUrl, Private, config) {

var services = Private(require('ui/saved_objects/saved_object_registry')).byLoaderPropertiesName;

Expand All @@ -23,6 +23,9 @@ define(function (require) {
controller: function ($scope, $element, $timeout) {
var self = this;

// The number of items to show in the list
$scope.perPage = config.get('savedObjects:perPage');

// the text input element
var $input = $element.find('input[ng-model=filter]');

Expand Down
2 changes: 1 addition & 1 deletion src/ui/public/partials/saved_object_finder.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<span class="finder-hit-count"><strong>{{finder.hitCount}}</strong> {{finder.hitCountNoun()}}</span>
</div>
</form>
<paginate list="finder.hits" per-page="5">
<paginate list="finder.hits" per-page="{{perPage}}">
<ul
class="list-group list-group-menu"
ng-class="{'select-mode': finder.selector.enabled}">
Expand Down

0 comments on commit 94a9e65

Please sign in to comment.