init
This commit is contained in:
28
OpenArchival.Blazor.FileViewer/FileViewers/PdfViewer.razor
Normal file
28
OpenArchival.Blazor.FileViewer/FileViewers/PdfViewer.razor
Normal file
@@ -0,0 +1,28 @@
|
||||
@namespace OpenArchival.Blazor.FileViewer
|
||||
|
||||
@implements IFileViewer
|
||||
@using Microsoft.JSInterop
|
||||
@using MudBlazor
|
||||
@using OpenArchival.DataAccess
|
||||
@inject IJSRuntime JSRuntime
|
||||
|
||||
<div style="width:100%; height: 1100px; max-height: 80vh; border: 1px solid var(--mud-palette-divider); border-radius: 4px; overflow: hidden; box-sizing: border-box;">
|
||||
<iframe src="@($"/api/files/{File.Id}")" style="width:100%; height:100%; border: none; display: block;" title="@File.OriginalName"></iframe>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public required FilePathListing File { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<int> OnHeightMeasured { get; set; }
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (firstRender)
|
||||
{
|
||||
// We report 1100, but the CSS max-height: 80vh will cap it in the carousel
|
||||
await OnHeightMeasured.InvokeAsync(1100);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user