Skip to content
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

Initializing jSignature on hidden container with automatic sizing #165

Open
hawajrambo opened this issue Mar 16, 2019 · 2 comments
Open

Comments

@hawajrambo
Copy link

Dear Developer,
jSignature calculates with it's container's size at initialization time.
In my case, dynamic content is prepared former, but showed at a later time with animation.
Because of the animation, the dynamic content is hidden until the animation begins.
So, there are "initializing" phase and "showing" phase.
Setting up the signature panel's parameters belongs to the initializing.
At initialization time, the signature panel's dimensions are 0 x 0, and therefore it doesn't work later.
I can call jSignature's onParentResized event, but it isn't public:
$("#"+pageName+"-signaturePad").jSignature('globalEvents').topics["jSignature.parentresized"][0]0;
Could you please make a public function for re-rendering the jSignature's canvas with keeping all the settings?
Maybe jSignature's initialization could wait for the container gets visible with MutationObserver.
Best Regards,
Gabor

@brinley
Copy link
Owner

brinley commented Mar 18, 2019

Did you try calling window.resize?

@hawajrambo
Copy link
Author

hawajrambo commented Mar 18, 2019

Thanks.
this fixes the problem: $(window).trigger("resize");

Here I wrote for you a test page with 2 more bugs:
jSignatureBugs-190318.ZIP
Gabor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants