jSignature icon indicating copy to clipboard operation
jSignature copied to clipboard

Provide a way to check if jSignature has been started

Open ThomasLandauer opened this issue 10 years ago • 2 comments

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 :-)

ThomasLandauer avatar Sep 02 '15 13:09 ThomasLandauer

can you post your workaround?

itajackass avatar Aug 31 '18 09:08 itajackass

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();
}

ThomasLandauer avatar Aug 31 '18 09:08 ThomasLandauer