import ScreenSizeDetection from '../ScreenSizeDetection';

export class PaginationController {

  public controlsMaxSize: number = 9;
  public paginationId: string;

  constructor(
    private $timeout
  ) {
    this.subscribeObservables();
  }

  private subscribeObservables(): void {
    ScreenSizeDetection.get().subscribe(screensize => {
      let controlsMaxSize;
      if (screensize === 'xs' || screensize === 'sm') {
        controlsMaxSize = 5;
      } else {
        controlsMaxSize = 9;
      }
      this.$timeout(() => {
        this.controlsMaxSize = controlsMaxSize;
      })
    });
  }
}
