[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:
Cilibiu Bogdan
2018-03-06 09:00:52 +02:00
committed by Denys Vuika
parent 8f63af1fbd
commit 69ac38713f
8 changed files with 99 additions and 22 deletions

View File

@@ -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;
}
}
}