Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Jules Colle

    (@jules-colle)

    I think I fixed in in version 0.1.6
    Can you check if it works for you?

    Plugin Author Jules Colle

    (@jules-colle)

    marking this as resolved

    The CF7 signature addon is not working in 1.1 This is a link to a demo on my site:
    https://www.craigtuckerlcsw.com/wordpress/signature-test/

    Any ideas for a fix or work around?

    If this helps, In the console I see this error:
    Uncaught TypeError: Cannot read property ‘addEventListener’ of null
    at https://www.mysite.com/wordpress/wp-content/plugins/contact-form-7-signature-addon/scripts.js?ver=3.2:56:10
    at NodeList.forEach (native)
    at https://www.mysite.com/wordpress/wp-content/plugins/contact-form-7-signature-addon/scripts.js?ver=3.2:11:27
    at NodeList.forEach (native)
    at HTMLDocument.<anonymous> (https://www.mysite.com/wordpress/wp-content/plugins/contact-form-7-signature-addon/scripts.js?ver=3.2:8:26)

    This only happens within the conditional markers.

    I got rid of the above error by adding a send button. Nevertheless, the canvas is not resizing on the click of the check box. I have looked at the code:

                //for compatibility with contact-form-7-signature-addon
                if (cf7signature_resized == 0 && typeof signatures !== 'undefined' && signatures.constructor === Array && signatures.length > 0 ) {
                    if (signatures[0].canvas.width == 0) {
                        for (var i = 0; i < signatures.length; i++) {
    
                            jQuery(".wpcf7-form-control-signature-body>canvas").eq(0).attr('width', jQuery(".wpcf7-form-control-signature-wrap").width());
                            jQuery(".wpcf7-form-control-signature-body>canvas").eq(0).attr('height', jQuery(".wpcf7-form-control-signature-wrap").height());
    
                            cf7signature_resized = 1;
                        }
                    }
                }
    

    For some reason it appears that it is not picking up the elements. When I look in the console, the canvas is still at 0 for width and height.

    I am able to pull out the signatures array. It is filled with this:

    [{"signature":{"velocityFilterWeight":0.7,"minWidth":0.5,"maxWidth":2.5,"penColor":"black","backgroundColor":"rgba(0,0,0,0)","_canvas":{},"_ctx":{},"points":[],"_lastVelocity":0,"_lastWidth":1.5,"_isEmpty":true,"_mouseButtonDown":false},"input":{"jQuery112408345313077967815":28},"canvas":{},"options":[]},{"signature":{"velocityFilterWeight":0.7,"minWidth":0.5,"maxWidth":2.5,"penColor":"black","backgroundColor":"rgba(0,0,0,0)","_canvas":{},"_ctx":{},"points":[],"_lastVelocity":0,"_lastWidth":1.5,"_isEmpty":true,"_mouseButtonDown":false},"input":{"jQuery112408345313077967815":28},"canvas":{},"options":[]}]

    Which looks like it may be right. However the code stops at next condition:

    if (signatures[0].canvas.width == 0)

    So it seems that either the syntax of this line is incorrect or there is something wrong with the way the array is built. That is what I can see so far.

    Drilling down further I can see that signatures[0] contains the followng:

     Object
     canvas: canvas#wpcf7_signature-386_signature.signature-386
     input: input#wpcf7_input_signature-386
     options: Array[0]
     signature: b
     __proto__: Object

    This seems about right but still I cannot make it past second conditional statment of:

    if (signatures[0].canvas.width == 0)

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘signature add on not working!’ is closed to new replies.