-
-
Notifications
You must be signed in to change notification settings - Fork 363
feat(PdfViewer): add UseGoogleDocs parameter #6170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -8,6 +8,17 @@ | |||||
| <PackageTips Name="BootstrapBlazor.PdfViewer" /> | ||||||
|
|
||||||
| <DemoBlock Title="@Localizer["PdfViewerNormalTitle"]" Introduction="@Localizer["PdfViewerNormalIntro"]" Name="Normal"> | ||||||
| <section ignore> | ||||||
| <div class="row g-3"> | ||||||
| <div class="col-12 col-sm-6"> | ||||||
| <BootstrapInputGroup> | ||||||
| <BootstrapInputGroupLabel DisplayText="UseGoogleDocs"></BootstrapInputGroupLabel> | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: Label text should be localized Use the Localizer for the label text to support localization, e.g., DisplayText="@localizer["UseGoogleDocs"]".
Suggested change
|
||||||
| <Switch @bind-Value="@_useGoogleDocs"></Switch> | ||||||
| </BootstrapInputGroup> | ||||||
| </div> | ||||||
| </div> | ||||||
| </section> | ||||||
| <PdfViewer Url="./samples/pdf-viewer.pdf" Height="620px" | ||||||
| NotSupportCallback="NotSupportCallback" OnLoaded="OnLoaded"></PdfViewer> | ||||||
| NotSupportCallback="NotSupportCallback" OnLoaded="OnLoaded" | ||||||
| UseGoogleDocs="@_useGoogleDocs"></PdfViewer> | ||||||
| </DemoBlock> | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,8 @@ public partial class PdfViewers | |
| [Inject, NotNull] | ||
| private ToastService? ToastService { get; set; } | ||
|
|
||
| private bool _useGoogleDocs = true; | ||
|
|
||
| private Task OnLoaded() => ToastService.Success("Pdf Viewer", Localizer["PdfViewerToastSuccessfulContent"]); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue: Toast title is hard-coded and inconsistent The success and error toasts use different titles ('Pdf Viewer' vs. 'PdfViewer'). Please standardize and consider localizing the title for consistency. |
||
|
|
||
| private Task NotSupportCallback() => ToastService.Error("PdfViewer", Localizer["PdfViewerToastNotSupportContent"]); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Using a non-standard
ignoreattribute may not behave as expectedConsider replacing the non-standard
ignoreattribute with an@ifblock, a CSS class liked-none, or a framework-supported directive to control visibility.Suggested implementation:
If you want to control the visibility dynamically, you can use an
@ifblock or bind the class to a variable. For example:or
Replace
showSectionwith your actual condition.