mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Rename pagerService factory to pagerFactory.
This commit is contained in:
parent
10dbff66cc
commit
6eeeab6833
6 changed files with 18 additions and 18 deletions
|
@ -10,7 +10,7 @@ export function DashboardListingController(
|
|||
confirmModal,
|
||||
kbnUrl,
|
||||
Notifier,
|
||||
pagerService,
|
||||
pagerFactory,
|
||||
Private,
|
||||
timefilter
|
||||
) {
|
||||
|
@ -62,7 +62,7 @@ export function DashboardListingController(
|
|||
this.pageOfItems = [];
|
||||
this.filter = '';
|
||||
|
||||
this.pager = pagerService.create(this.items.length, 20, 1);
|
||||
this.pager = pagerFactory.create(this.items.length, 20, 1);
|
||||
|
||||
/**
|
||||
* Boolean that keeps track of whether hits are sorted ascending (true)
|
||||
|
|
|
@ -9,7 +9,7 @@ export function VisualizeListingController(
|
|||
confirmModal,
|
||||
kbnUrl,
|
||||
Notifier,
|
||||
pagerService,
|
||||
pagerFactory,
|
||||
Private,
|
||||
timefilter
|
||||
) {
|
||||
|
@ -63,7 +63,7 @@ export function VisualizeListingController(
|
|||
this.pageOfItems = [];
|
||||
this.filter = '';
|
||||
|
||||
this.pager = pagerService.create(this.items.length, 20, 1);
|
||||
this.pager = pagerFactory.create(this.items.length, 20, 1);
|
||||
|
||||
/**
|
||||
* Remember sort direction per property.
|
||||
|
|
|
@ -1 +1 @@
|
|||
import './pager_service.factory';
|
||||
import './pager_factory';
|
||||
|
|
|
@ -2,7 +2,7 @@ function clamp(val, min, max) {
|
|||
return Math.min(Math.max(min, val), max);
|
||||
}
|
||||
|
||||
export class PagerService {
|
||||
export class Pager {
|
||||
constructor(totalItems, pageSize, startingPage) {
|
||||
this.currentPage = startingPage;
|
||||
this.totalItems = totalItems;
|
12
src/ui/public/pager/pager_factory.js
Normal file
12
src/ui/public/pager/pager_factory.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
import uiModules from 'ui/modules';
|
||||
import { Pager } from './pager';
|
||||
|
||||
const app = uiModules.get('kibana');
|
||||
|
||||
app.factory('pagerFactory', () => {
|
||||
return {
|
||||
create(...args) {
|
||||
return new Pager(...args);
|
||||
}
|
||||
};
|
||||
});
|
|
@ -1,12 +0,0 @@
|
|||
import uiModules from 'ui/modules';
|
||||
import { PagerService } from './pager_service';
|
||||
|
||||
const app = uiModules.get('kibana');
|
||||
|
||||
app.factory('pagerService', () => {
|
||||
return {
|
||||
create(...args) {
|
||||
return new PagerService(...args);
|
||||
}
|
||||
};
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue