Disabling ajax in month view

Home Forums Additional Help Translations Disabling ajax in month view

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1086850
    3ejoueur
    Participant

    We had a problem when switching months in english it was switching to french.We found out it was because of ajax.

    We tried to disable ajax in month view following this thread : https://theeventscalendar.com/support/forums/topic/disable-ajax-in-month-view/

    It is working great but now the pop-up in the top right corner for choosing a date is not working. Is there a way to have a refresh page on the pop-up instead of ajax ?

    Thanks in advance

    #1087558
    Nico
    Member

    Howdy @3ejoueur,

    Welcome to our support forums and thanks for reaching out to us.

    Glad to see you could solve the first issue, not sure about the one you are trying to solve now. Can you clarify a bit on the following:

    the pop-up in the top right corner for choosing a date is not working.

    Not sure if you are referring to the dropdown to switch views? A screenshot will be of much help here. You can upload it to an image sharing service and share the link in your reply (http://cloudup.com, http://imgur.com, etc).

    Is there a way to have a refresh page on the pop-up instead of ajax ?

    Maybe when I know which element you are talking about the above will be obvious. If you can clarify though it would be great.

    Plase let me know about it,
    Best,
    Nico

    #1087666
    3ejoueur
    Participant

    Hello Nico,

    Thanks for the quick reply.

    Here is the image: http://screencast.com/t/obLpQlgIq

    Here is the url of the staging site : http://ayers.3ejoueur.com/en/events/

    You will see that when you choose a month it is using ajax so it is switching to french. We would like that when you click on a month it does a refresh on the page, not ajax. This way it would stay in english.

    Thanks in advance
    Team 3ejoueur

    #1088018
    Nico
    Member

    Hey,

    Thanks so much for clarifying on this! On the top off my head I’m not sure how to do this. But I guess I can run some tests, to see if we can “alter” the link behaviour via JS, and prevent the ajax call.

    I’ll dive into this and give you a heads-up soon,
    Have a great weekend,
    Nico

    #1089019
    3ejoueur
    Participant

    Thanks a lot Nico !

    And if you have any questions do not hesitate to contact us.

    #1089424
    Nico
    Member

    Welcome, just a quick note I’ve been trying to find a way around this but still didn’t nail it. I will ask for help from the dev team.

    Hopefully tomorrow I’ll have a solution 🙂

    Thanks for the patience,
    Best,
    Nico

    #1091193
    Nico
    Member

    Hey folks,

    Sorry I’m still working on this, I’ve spended a fair amount of time digging into this but still couldn’t find the solution. It seems to be a lot simpler tan it really is! This week the forums activity was a bit intense after the release, but just wanted you to know this is still in my radar!

    Have a great weekend,
    Nico

    #1091943
    Nico
    Member

    Hi,

    Well, I could give this sometime and I came up with a simple way of re-loading the view when the date is changed in the picker. It’s not preventing the actual ajax call but it might work for you anyway. Just paste the snippet in your functions.php and replace the calendar_url with the site URL:


    function tribe_switch_month() { ?>
    <script>

    var calendar_url = 'http://site.com/events/';
    var tribe_bar_date = tribe_ev.state.date;

    jQuery( document ).ready( function() {
    jQuery( '#tribe-bar-date' ).on( 'change', function (){
    if ( tribe_bar_date != tribe_ev.state.date ) location.href = calendar_url + tribe_ev.state.date;
    } );
    } );
    </script>
    <?php
    }
    add_action('wp_head', 'tribe_switch_month');

    Please let me know if this works for you,
    Best,
    Nico

    #1098377
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Disabling ajax in month view’ is closed to new replies.