[ACA-1078] next/prev navigation for the Viewer (#187)

* basic navigation through the folder

* carousel mode for libraries

* code polishing

* save and restore sorting settings

* get user sorting preferences into account

* sorting fixes

* full test coverage
This commit is contained in:
Denys Vuika
2018-02-08 18:39:19 +00:00
committed by Cilibiu Bogdan
parent 34e322e9f6
commit 3cff48cac5
20 changed files with 1188 additions and 184 deletions

View File

@@ -74,10 +74,11 @@
currentFolderId="-recent-"
selectionMode="multiple"
[navigate]="false"
[sorting]="[ 'modifiedAt', 'desc' ]"
[sorting]="sorting"
[contextMenuActions]="true"
[contentActions]="false"
[imageResolver]="imageResolver"
(sorting-changed)="onSortingChanged($event)"
(node-dblclick)="onNodeDoubleClick($event.detail?.node?.entry)"
(node-select)="onNodeSelect($event, documentList)">

View File

@@ -43,12 +43,19 @@ export class RecentFilesComponent extends PageComponent implements OnInit, OnDes
private subscriptions: Subscription[] = [];
sorting = [ 'modifiedAt', 'desc' ];
constructor(
private router: Router,
private route: ActivatedRoute,
private content: ContentManagementService,
preferences: UserPreferencesService) {
super(preferences);
const sortingKey = preferences.get('recent-files.sorting.key') || 'modifiedAt';
const sortingDirection = preferences.get('recent-files.sorting.direction') || 'desc';
this.sorting = [sortingKey, sortingDirection];
}
ngOnInit() {
@@ -81,4 +88,9 @@ export class RecentFilesComponent extends PageComponent implements OnInit, OnDes
this.documentList.reload();
}
}
onSortingChanged(event: CustomEvent) {
this.preferences.set('recent-files.sorting.key', event.detail.key || 'modifiedAt');
this.preferences.set('recent-files.sorting.direction', event.detail.direction || 'desc');
}
}