Skip to content

Commit

Permalink
Rename pagerService factory to pagerFactory.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjcenizal committed Feb 6, 2017
1 parent 10dbff6 commit 6eeeab6
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function DashboardListingController(
confirmModal,
kbnUrl,
Notifier,
pagerService,
pagerFactory,
Private,
timefilter
) {
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function VisualizeListingController(
confirmModal,
kbnUrl,
Notifier,
pagerService,
pagerFactory,
Private,
timefilter
) {
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/ui/public/pager/index.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
import './pager_service.factory';
import './pager_factory';
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
12 changes: 12 additions & 0 deletions src/ui/public/pager/pager_factory.js
Original file line number Diff line number Diff line change
@@ -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);
}
};
});
12 changes: 0 additions & 12 deletions src/ui/public/pager/pager_service.factory.js

This file was deleted.

0 comments on commit 6eeeab6

Please sign in to comment.