brinley / jSignature

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

Initialize with data #99

Open BitStinker opened 8 years ago

BitStinker commented 8 years ago

I'm using this in a a jQuery Mobile environment with the signature on its own page.

On pagecreate I initialize attempting to use an already determined signature:

$( '#signoff' ).jSignature( 'importData', signas );

but I get a blank canvas.

If I try this:

$( '#signoff' ).jSignature(); $( '#signoff' ).jSignature( 'importData', signas );

I get a blank canvas.

If I try this:

// in page create $( '#signoff' ).jSignature();

// in pagechange $( '#signoff' ).jSignature( 'importData', signas );

I get a blank canvas.

If, instead (using that last example) I go to the page, then go to the home page, then back to the signature page, I get the signature I'm looking for.

It appears that there is a delay from the time the element is signature enabled to the time when it will accept an 'importData' command.

Is there a way to 'importData' on initialization, say with

$( '#signoff' ).jSignature( { data : signas } );

?

brinley commented 8 years ago

At present no, but it sounds like a good feature to implement