mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-2388, ADF-2375] PDF Viewer - show buffer thumbnail on pagechange (#3011)
* disable thumbnails button until document is loaded * show buffer thumbnail on page change * correct value property * correct test
This commit is contained in:
committed by
Denys Vuika
parent
8f63af1fbd
commit
69ac38713f
@@ -35,7 +35,8 @@ export class PdfThumbListComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
renderItems = [];
|
||||
|
||||
private items = [];
|
||||
private itemHeight: number = 114;
|
||||
private margin: number = 15;
|
||||
private itemHeight: number = 114 + this.margin;
|
||||
|
||||
@ContentChild(TemplateRef)
|
||||
template: any;
|
||||
@@ -87,7 +88,7 @@ export class PdfThumbListComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
return;
|
||||
}
|
||||
|
||||
this.element.nativeElement.scrollTop = Math.floor(index - 1 ) * this.itemHeight;
|
||||
this.element.nativeElement.scrollTop = index * this.itemHeight;
|
||||
|
||||
this.calculateItems();
|
||||
}
|
||||
@@ -133,5 +134,9 @@ export class PdfThumbListComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
if (index < 0) {
|
||||
this.scrollInto(event.pageNumber);
|
||||
}
|
||||
|
||||
if (index >= this.renderItems.length - 1) {
|
||||
this.element.nativeElement.scrollTop += this.itemHeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user