made annotations a bit prettier

This commit is contained in:
Timo Bejan 2020-10-14 13:28:41 +03:00
parent d4365188a8
commit 5b73d5ff23
2 changed files with 19 additions and 8 deletions

View File

@ -34,7 +34,8 @@
<div class="right-fixed-container">
<!-- Quick navigation tab-->
<div class="vertical" (click)="selectTab('NAVIGATION')" [ngClass]="{ active: navigationTab}" #navigationTabElement>
<div class="vertical" (click)="selectTab('NAVIGATION')" [ngClass]="{ active: navigationTab}"
#navigationTabElement>
<div class="tab-title" [ngClass]="navigationTab ? 'heading' : 'subheading'">
Quick Navigation
</div>
@ -62,7 +63,8 @@
</div>
<!-- Annotations tab-->
<div (click)="selectTab('ANNOTATIONS')" class="vertical" [ngClass]="{ active: annotationsTab }" #annotationsContainer>
<div (click)="selectTab('ANNOTATIONS')" class="vertical" [ngClass]="{ active: annotationsTab }"
#annotationsContainer>
<div class="tab-title" [ngClass]="annotationsTab ? 'heading' : 'subheading'">
Annotations
</div>
@ -73,10 +75,10 @@
attr.annotation-page="{{annotation.getPageNumber()}}"
(click)="selectAnnotation(annotation)"
[ngClass]="{ active: selectedAnnotation === annotation }">
<div class="clamp-1">{{annotation.Id}}</div>
<div>Page {{annotation.getPageNumber()}}</div>
<div>{{annotation.getContents()}}</div>
<div>{{annotation.getStatus()}}</div>
<div><strong>Type: </strong>{{getType(annotation.Id)}}</div>
<div><strong>Dictionary: </strong>{{getDictionary(annotation.Id)}}</div>
<div><strong>Page: </strong> {{annotation.getPageNumber()}}</div>
<div *ngIf="annotation.getContents()"><strong>Content: </strong>{{annotation.getContents()}}</div>
</div>
</div>
</div>

View File

@ -221,14 +221,23 @@ export class FilePreviewScreenComponent implements OnInit {
}
}
getType(id: string) {
const parts = id.split(':');
return parts.length >= 1 ? parts[0] : 'n/a';
}
getDictionary(id: string) {
const parts = id.split(':');
return parts.length >= 2 ? parts[1] : 'n/a';
}
}
(function() {
(function () {
// @ts-ignore
if (!Element.prototype.scrollIntoViewIfNeeded) {
// @ts-ignore
Element.prototype.scrollIntoViewIfNeeded = function(centerIfNeeded) {
Element.prototype.scrollIntoViewIfNeeded = function (centerIfNeeded) {
centerIfNeeded = arguments.length === 0 ? true : !!centerIfNeeded;
const parent = this.parentNode,