Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get the current instance? #23

Closed
mexac opened this issue Dec 7, 2011 · 3 comments
Closed

How to get the current instance? #23

mexac opened this issue Dec 7, 2011 · 3 comments

Comments

@mexac
Copy link

mexac commented Dec 7, 2011

When I call the plugin method "$('.sigPad').signaturePad(options)" on the HTML element it also returns and API for the instance, so we can assign it to some global variable
var sigPad = $('.sigPad').signaturePad(options);

Is it possible to change the method signaturePad(options) so it will return the current instance (or create a new instance if it was not done previously)?
For example:
var img = $('.sigPad').signaturePad().getSignatureImage();

at present it creates a new instance and returns empty image. I have to use a global variable to solve it

Also regarding option.lineTop. IMHO it's better to use it as %.
function drawSigLine() {
...
canvasContext.moveTo(settings.lineMargin, element.height * settings.lineTop * 0.01)
...
}

Thanks.

@thomasjbradley
Copy link
Contributor

Yeah, it seems like this is a common issue. I'll change the initialization method to act this way also.

@anand1979
Copy link

Hi,

I am facing an issue, not able get the output of the capture image, since the getSignatureImage() displays only 0. Please advise what to do

@thomasjbradley
Copy link
Contributor

What browser are you using?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants