JavaScript Conflicts Causing Resizing Issues

Home Forums Calendar Products Events Calendar PRO JavaScript Conflicts Causing Resizing Issues

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #1297449
    JOANNA S
    Participant

    Hi

    We have an issue on our development site (it is due to go live this week) with the Events Calendar PRO plugin.

    It appears to be conflicting with our Slick Slider JavaScript code.

    We have attempted to dequeue it using documented methods but the file refuses to budge.

    We have manually removed it from the plugin, which fixes the issue, but not ideal as of course future updates will override this.

    The file causing issues is /the-events-calendar/vendor/jquery-resize/jquery.ba-resize.js

    Please advise on how we can resolve this conflict i.e. by dequeuing the file.

    To access the site on prompt please use [Redacted – Barry] as the username and password.

    You can replicate the issue on a variety of pages including Theme & Events by resizing the browser and looking at the gallery / slider with thumbnails and how it reacts. Of course at the moment we do have the fix in place to prevent this, by removing that file.

    #1298232
    Shelby
    Participant

    Hi there Joanna,

    Great question, and I’m happy to help! 🙂

    I think you’ll find that this free extension will help out with dequeuing files as you need. 🙂

    Please let me know if you have any follow up questions to this or need any clarification on this!

    Best,

    Shelby 🙂

    #1298264
    JOANNA S
    Participant

    Thanks Shelby.

    Unfortunately, this does not target the file causing the conflict. Could you please provide the dequeue hook for jquery.ba-resize.js and I will add this to functions.php directly.

    #1298699
    Shelby
    Participant

    Hey Joanna,

    Thanks for clarifying. 🙂

    I’ve done some additional digging into this topic, and I found a very similar thread between user Marty, and support team member Brook, that I think will give you the answers you need, as that specific file is mentioned with a similar request, and Marty reported that he was able to implement the solution. You can view that thread with this link.

    Please let me know if this helps and if you have any follow up questions to this issue!

    Best,

    Shelby 🙂

    #1298910
    JOANNA S
    Participant

    Hi Shelby,

    I’ve attempted dequeuing using the suggested hook, but the file is still present.

    Can you please confirm if this hook is still valid?

    function tribe_dequeue_script() {
       wp_dequeue_script( 'tribe-events-jquery-resize' );
    }
    add_action( 'wp_print_scripts', 'tribe_dequeue_script', 100 );
    #1299323
    Shelby
    Participant

    Hi Joanna,

    We’ve looked over your snippet, and have revised it below. You should insert the following in your functions.php file. Please let me know how this goes! 🙂

    <?php
    
    /**
     * An example for how to dequeue a script
     *
     * Obtain the handle of your script by searching through the code, and then 
     * add a wp_deregister_script() function call for that handle.
     */
    function tribe_dequeue_script_example() {
     wp_deregister_script( 'tribe-events-jquery-resize' );
    }
    add_action( 'wp_enqueue_scripts', 'tribe_dequeue_script_example', PHP_INT_MAX );
    add_action( 'admin_enqueue_scripts', 'tribe_dequeue_script_example', PHP_INT_MAX );
    #1299821
    JOANNA S
    Participant

    Unfortunately, the script is still enqueued after using this. Any further suggestions?

    #1301673
    Barry
    Member

    Apologies for the delay, Joanna. The following code ought to be a good starting point, but please do heed the advice in the comments as removing a script like this (which other scripts depend upon) can potentially cause breakages:

    /**
     * Stops The Events Calendar from enqueuing jquery.ba-resize.js.
     * 
     * Note that this will break various script dependencies, so it should
     * be used with care and appropriate checks added to prevent it from 
     * being used on pages that truly require it.
     */
    function dequeue_tribe_jquery_resize() {
    	wp_deregister_script( 'tribe-events-jquery-resize' );
    	wp_dequeue_script( 'tribe-events-jquery-resize' );
    }
    
    add_action( 'wp_enqueue_scripts', 'dequeue_tribe_jquery_resize', 100 );
    #1301912
    Drew
    Participant

    We are having the same issue on our dev site that is also about to go live. The above code did not work for us. As a temporary fix, we have manually deactivated the two files in the vendor/jquery-resize directory. This solved the issue, but is super hacky. It will work until a bug fix is released or we can get the function.php route to work.

    #1302030
    Barry
    Member

    Interesting – it certainly works for me (with the caveat I already provided that it will cause breakages on event views – because other scripts depend on this one) … though it occurs that perhaps the reason it doesn’t in your case is that you added the code to your theme’s functions.php file.

    Instead, try adding it to a custom plugin (placing it in a new file such as wp-content/mu-plugins/tec-customizations.php for instance might work better for you).

    #1321311
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘JavaScript Conflicts Causing Resizing Issues’ is closed to new replies.