mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-30 18:27:45 -05:00
adjustable page size fixes #8
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormControl, FormGroup } from '@angular/forms';
|
||||
import { SavedViewConfig } from 'src/app/data/saved-view-config';
|
||||
import { GENERAL_SETTINGS } from 'src/app/data/storage-keys';
|
||||
import { DocumentListViewService } from 'src/app/services/document-list-view.service';
|
||||
import { SavedViewConfigService } from 'src/app/services/saved-view-config.service';
|
||||
|
||||
@Component({
|
||||
@@ -9,11 +12,14 @@ import { SavedViewConfigService } from 'src/app/services/saved-view-config.servi
|
||||
})
|
||||
export class SettingsComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private savedViewConfigService: SavedViewConfigService
|
||||
) { }
|
||||
settingsForm = new FormGroup({
|
||||
'documentListItemPerPage': new FormControl(+localStorage.getItem(GENERAL_SETTINGS.DOCUMENT_LIST_SIZE) || GENERAL_SETTINGS.DOCUMENT_LIST_SIZE_DEFAULT)
|
||||
})
|
||||
|
||||
active
|
||||
constructor(
|
||||
private savedViewConfigService: SavedViewConfigService,
|
||||
private documentListViewService: DocumentListViewService
|
||||
) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
}
|
||||
@@ -22,4 +28,8 @@ export class SettingsComponent implements OnInit {
|
||||
this.savedViewConfigService.deleteConfig(config)
|
||||
}
|
||||
|
||||
saveSettings() {
|
||||
localStorage.setItem(GENERAL_SETTINGS.DOCUMENT_LIST_SIZE, this.settingsForm.value.documentListItemPerPage)
|
||||
this.documentListViewService.updatePageSize()
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user