Home › Forums › Calendar Products › Events Calendar PRO › JavaScript Conflicts Causing Resizing Issues
- This topic has 11 replies, 4 voices, and was last updated 8 years, 9 months ago by
JOANNA S.
-
AuthorPosts
-
June 13, 2017 at 12:54 pm #1297449
JOANNA S
ParticipantHi
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.
June 14, 2017 at 7:35 pm #1298232Shelby
ParticipantHi 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 🙂
June 14, 2017 at 9:29 pm #1298264JOANNA S
ParticipantThanks 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.
June 15, 2017 at 12:04 pm #1298699Shelby
ParticipantHey 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 🙂
June 15, 2017 at 8:23 pm #1298910JOANNA S
ParticipantHi 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 );June 16, 2017 at 12:39 pm #1299323Shelby
ParticipantHi 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 );June 18, 2017 at 6:14 pm #1299821JOANNA S
ParticipantUnfortunately, the script is still enqueued after using this. Any further suggestions?
June 22, 2017 at 6:50 am #1301673Barry
MemberApologies 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 );June 22, 2017 at 12:47 pm #1301912Drew
ParticipantWe 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.
June 22, 2017 at 4:48 pm #1302030Barry
MemberInteresting – 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).
July 14, 2017 at 9:35 am #1321311Support Droid
KeymasterHey 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 -
AuthorPosts
- The topic ‘JavaScript Conflicts Causing Resizing Issues’ is closed to new replies.
