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

Width/Height options do not work as described in instructions #5

Open
r-murphy opened this issue Jan 30, 2014 · 2 comments
Open

Width/Height options do not work as described in instructions #5

r-murphy opened this issue Jan 30, 2014 · 2 comments

Comments

@r-murphy
Copy link

In the readme file, it says that width and height use the parent values if these options are not set. Implying that the options should have higher priority.
But the actual way it behaves is that the parent value has higher priority, and these values are only used if the parent container is too small.

Maybe should be something like this?

if(noparent)
{
    width = settings.width || $elm.parent().width();
    height = settings.height || $elm.parent().height();
}
else 
{
    $elm.append(canvas);
    width = settings.width || $elm.innerWidth();
    height = settings.height || $elm.innerHeight();
}

The width/height < 2 check becomes redundant if this logic is used.
Not sure if this will break existing integrations, so it might need to be a new option. Or just reflect the actual behaviour in the instructions.

Thanks

@jimdoescode
Copy link
Owner

Thanks for the heads up. I'll check it out.

@tapash2407
Copy link

Height can be set by changing the code in "jquery.jqscribble.js". Please find below the code:

if(noparent)
{
width = this.parent().width();
height = this.parent().height();
}

          //newly added
    if (options != undefined && options.height!=undefined){

       height = options.height;
    }

if(width < 2)width = settings.width;
if(height < 2)height = settings.height;

Same way width can also be set.

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