brinley / jSignature

jQuery plugin for adding web signature functionality
http://www.unbolt.net/jSignature
693 stars 530 forks source link

Canvas not rendering after ajax call #84

Closed AleksandarTokarev closed 9 years ago

AleksandarTokarev commented 9 years ago

Hello, I am using jSignature with rails, and i have a dropdown menu with users, and each user has his own signature. Basically i am using Ajax to call action in controller, which renders partial which has the signature. After making the Ajax call, everything is rendered ok, except the canvas (there is nothing on the screen, and i can not sign anything) Here is the signature on first render of page (without any Ajax, just normal rendering of partial in view) http://screencloud.net/v/9g8b and it is ok.

After i change the value of dropdown, i do ajax call and canvas is empty ( i can not draw ) https://screencloud.net/v/hDTF

zevero commented 9 years ago

You may try to trigger a resize Event

window.dispatchEvent(new Event('resize'));

or control the height via css

canvas.jSignature { height: 270px; }