jSignature
jSignature copied to clipboard
Provide a way to check if jSignature has been started
When using jSignature on a hidden div, you have to initialize it only after the div is shown (cause otherwise it takes 0x0 pixels as size). When having the parent div toggle-able (i.e. show/hide repeatedly), when doing "show", you have to check if jSignature has already been started or not (otherwise you get multiple canvas).
The only (ugly) solution/workaround I see, is to wrap the initialization in a try...catch block. A cleaner way would be nice :-)
can you post your workaround?
The idea: Start jSignature only if some jSignature command fails. Don't know why I chose getSettings:
try
{
$('#jSignatureTest').jSignature('getSettings');
}
catch(error)
{
$('#jSignatureTest').jSignature();
}