Tagged: 

Viewing 30 posts - 1 through 30 (of 36 total)
  • Author
    Posts
  • #1017437

    Hi everyone,
    Since the last update of enfold, when I have the file avia.js in my child theme, it breaks the burger menu.
    Did you notice this bug ? Will you fix this in the next update ?
    Thanks

    #1017488

    Hey Underkult,

    Did you add any customisations to the file in question? If so then please try to remove them and add them to a fresh copy from the parent theme instead to see if that helps. If it works with out your customisations then they are likely the cause of your problems.

    Best regards,
    Rikard

    #1017537

    Hi Rikard,
    Thank you for you quick reply.
    Even if I replace the file “avia.js” by exactly the same without any customisations, it causes the bug.
    When I open the menu burger, the closing link is’nt working.
    I notice this strange behaviour on several websites, thats why I thought it was beacause of you last updates.
    Thank you for your time.

    #1017546

    Hi Rikard,
    i use this method to replace avia.js :

    // Replace avia.js
    function change_aviajs() {
       wp_dequeue_script( 'avia-default' );
       wp_enqueue_script( 'avia-default-child', get_stylesheet_directory_uri().'/js/avia.js', array('jquery'), 2, true );
    }
    add_action( 'wp_enqueue_scripts', 'change_aviajs', 100 );

    Maybe it isn’t working because I made a mistake somewhere ?

    #1017719

    Hi,

    Thanks for the update, where can we see the problem on an actual site? Please include admin login details to the site as well so that we can have a look at the backend.

    Best regards,
    Rikard

    #1017787
    This reply has been marked as private.
    #1017836

    Hi,

    Thanks for that, I wanted to comment out the code you referenced but the editor function looks to be removed on your installation. Could you try it out yourself maybe? What happens if you just run the default avia.js from the parent theme?

    Also, it looks like you have done a lot of customisations to the theme in general so it might be a CSS problem. You might want to try to remove all your custom CSS temporarily as well to see if that makes any difference to the mobile menu behaviour.

    Best regards,
    Rikard

    #1017846

    Hi Rikard,
    What is the editor function ? I never used that before.
    If I run the default avia.js from the parent theme the burger menu run fine.
    I tried to remove my css file with my customisations but it didn’t fix the menu’s bug.
    I share my FTP logins if you want to look deeper in the files of the website.

    #1018134

    Hi,

    The editor function can be found under Appearance->Editor by default, but a lot of hosting providers turn that off to avoid non-developer from making edits to the code of the theme.

    If the burger menu works fine with the default file then it’s very likely that your customisations are at fault. Maybe you could try to review the custom code to see if you can locate the problem?

    Best regards,
    Rikard

    #1018187

    Hi Rikard,
    I already tried to remove all my customisations, css and scripts to see if the problem was caused by them but it didn’t.
    I don’t understand why when I load the exactly same file from your theme in my child theme it isn’t working.
    Best Regards

    #1018388

    Hi,

    I’m not sure to be honest with you, but I’m guessing there is something wrong with the dequeue/enqueue function you are using. Could you try to only dequeue the default file to see if it actually works? All things depending on that file should fail if the dequeue actually works.

    Best regards,
    Rikard

    #1018883

    Hi Rikard,
    You were right, If I only dequeue the default Avia.js , the burger menu works.
    So here is my code in my functions file :

    function change_aviajs() {
       wp_dequeue_script( 'avia-default' );
      
    }
    add_action( 'wp_enqueue_scripts', 'change_aviajs', 100 );

    But it is working because the default file from Enfold theme is still loaded…

    The following code isn’t working as well :

    function change_aviajs() {
       wp_dequeue_script( 'avia-default' );
      
    }
    add_action( 'wp_dequeue_scripts', 'change_aviajs', 100 );
    #1019171

    Hi Underkult,

    The two codes I see above are the same. Is it correct? Did you get it working for you?

    Best regards,
    Victoria

    #1019398

    Hi Victoria,
    No it isn’t working. It is impossible to load a custom avia.js in a child-theme and have the burger menu working properly.

    #1019454

    Hi,

    Thanks for the update. Please try this instead:

    function wp_change_aviajs() {
       wp_deregister_script( 'avia-default' );
       wp_enqueue_script( 'avia-default-child', get_stylesheet_directory_uri().'/js/avia.js', array('jquery'), 2, true );
    }
    add_action( 'wp_enqueue_scripts', 'wp_change_aviajs', 100 );

    Best regards,
    Rikard

    #1019511

    Hi Rikard,
    If I use your code, my burger menu works fine,
    but the sliders and the video section doesn’t work.
    Best Regards

    #1019756

    Hi,

    Thanks for the update, are you seeing any error messages in the console if you inspect the page in your browser? Are you sure that the file you want to enqueue is placed in the search path specified in the code?

    Best regards,
    Rikard

    #1019870

    Hi Rikard,
    When I inspect the console, I don’t see anything.
    My file is placed at the right place in my child-theme.
    Best Regards

    #1021427

    Hi,

    What did you change in the avia.js file? Please get the latest copy of the avia.js file and then readd your modifications.

    Best regards,
    Ismael

    #1022093

    Hi,
    I manage to add my modification in an other javascript file independently.
    So the avia.js file is exactly the same than enfold’s.
    I notice the bug on several websites so I think it is caused by your theme, not by my minor modifications.

    Best Regards

    • This reply was modified 6 years, 1 month ago by Underkult.
    #1022190

    Hi,

    What is the name of the file? Can we take a look? This is the only error that I see in the console.

    www-widgetapi.js:99 Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://www.youtube.com') does not match the recipient window's origin ('http://ebenisterie-loutan.ch').
    

    Best regards,
    Ismael

    #1022252

    Hi Ismael,
    I give the access for my FTP.
    My file is named “cadre.js” and it is in the folder “js” in my child theme.

    Best Regards

    #1022528

    Hi,

    The avia.js file in the child theme folder is still active.

    // Replace avia.js
    function wp_change_aviajs() {
       wp_dequeue_script( 'avia-default' );
       wp_enqueue_script( 'avia-default-child', get_stylesheet_directory_uri().'/js/avia.js', array('jquery'), 2, true );
    }
    add_action( 'wp_print_scripts', 'wp_change_aviajs', 100 );
    

    I thought you disabled it? Please get the latest version of the avia.js file and then redo the modifications.

    Best regards,
    Ismael

    #1022778

    Hi Ismael,
    The goal of this topic is to do minor modifications to avia.js in the child theme. Why I would disable it ?
    I updated my website to the last version of Enfold and I replaced The avai.js of my child theme but the bug is still here.
    Best Regards

    #1022833

    Hi,

    What did you add or modify in the avia.js file?

    Best regards,
    Ismael

    #1022896

    Hi,
    It is exactly the same, I didn’t add anything or modified the file.
    I removed my customisations to show you the bug isn’t caused by them.
    Best Regards

    #1023299

    Hi,

    The mobile menu is working properly when the includes > helper-main-menu.php and the child theme’s avia.js files are disabled.

    Best regards,
    Ismael

    #1023307

    Hi Ismael,
    So are you telling me that we can’t modify avia.js with a child theme ?
    It’s too bad, I use this fonctionality on many websites I build with Enfold.
    I’m disappointed that you remove this option with you last updates.
    Best Regards

    #1023826

    Hi,

    You can modify the avia.js file but you have to make sure that you’re using the updated version.

    Best regards,
    Ismael

    #1023994

    Hi Ismael,
    I’m sure that I am using the right version.
    I don’t understand why it is not working.
    Best Regards

Viewing 30 posts - 1 through 30 (of 36 total)
  • You must be logged in to reply to this topic.