jSignature icon indicating copy to clipboard operation
jSignature copied to clipboard

Initializing jSignature on hidden container with automatic sizing

Open hawajrambo opened this issue 5 years ago • 2 comments

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

hawajrambo avatar Mar 16 '19 00:03 hawajrambo

Did you try calling window.resize?

brinley avatar Mar 18 '19 03:03 brinley

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

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

hawajrambo avatar Mar 18 '19 13:03 hawajrambo