-
Notifications
You must be signed in to change notification settings - Fork 189
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
SecondaryToolbar empty while using a custom main toolbar #2684
Comments
That's probably because I invented the I haven't tried it yet, but I believe If you need support, don't hesitate to ask. I'm keeping the ticket open until you tell me you've managed to solve your issue. |
Thank you for your answer, but I guess that's not going to work, or I got you wrong. I've tried to add my custom material button inside your <pdf-shy-button
[cssClass]="'lg' | responsiveCSSClass"
title="open PDF file in a new tab"
primaryToolbarId="sidebarToggle"
[order]="1"
[closeOnClick]="true"
>
<button
custom-icon-big-button
id="sidebarToggle"
color="primary"
class="my-toggleable"
matTooltip="Übersichtsleiste öffnen / schließen"
>
<mat-icon svgIcon="tb-viewverticalformonly"></mat-icon>
</button>
</pdf-shy-button> I've also played around with adding just the mat-icon, use my custom button attributes directly on the pdf-shy-button,.... There was no way to get that running. |
Sorry for answering late! Yes, you're right, I didn't manage to implement your elegant approach. Instead, my implementation looks like so: <pdf-shy-button
[cssClass]="'lg' | responsiveCSSClass"
title="export an image"
primaryToolbarId="nestedComponent"
[order]="1"
[closeOnClick]="true"
[action]="onClick"
>
<button #nestedContent
id="sidebarToggle"
color="primary"
class="toolbarButton"
matTooltip="export an image"
(click)="onClick()"
>
<mat-icon>photo_camera</mat-icon>
</button>
</pdf-shy-button> The key differences are:
public onClick?: () => void; // this is a attribute
constructor() {
const emitter = this.pageViewModeChange;
const self = this; // necessary because onClick is called from outside, hence this may be undefined
this.onClick = () => {
// implement your custom action
};
}
public ngOnDestroy(): void {
this.onClick = undefined;
} |
…ady works, I've made it an alpha version in order to be able to test and document it thoroughly); the secondary toolbar now shows the button icons again
I'm using the ngx-extended-pdf-viewer with a custom main toolbar with material design components (mat-toolbar, mat-icon-button,...) to fit the rest of my application. After I've updated the ngx-extended-pdf-viewer from 17.0.0 to 21.4.5, the SecondaryToolbar menu, which is not customized, is empty. The popup appears, but it does not contain any buttons.
Do you have any tips or hints? Maybe someone else stumbled on that problem?
The text was updated successfully, but these errors were encountered: