• I’m a developer, so I appreciate being able to modify all the view files. On the down side, I found an error in 2 script files (which is why it only gets 4 stars):

    tribe-events.js
    tribe-events-ajax-calendar.js

    whenever there’s a $('#tribe-events').on(
    it needs to be replaced with $('#tribe-events-content-wrapper').on(

    Otherwise, as soon as you click on the link for the previous month or next month, the previous/next month links no longer work, and the hover effect over an event in the calendar won’t work either.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hey there! I am the developer who wrote those lines. In fact that js is as it should be. If those handlers are not working for you until you nest deeper in, then it means there is an issue with the install. Do you have a link to a live example so i could check if there is some other issue? Thank you!

    To explain: #tribe-events is a persistent wrapper div our plugin outputs outside of ajax modified content and is designed specifically to store certain settings for js as data attributes, and also to bind event handlers for a few elements destroyed during ajax.

    Thread Starter yitwail

    (@yitwail)

    thanks for the reply. I assumed it was a difference between the deprecated live() and on(). The jquery online doc for on() says,

    Event handlers are bound only to the currently selected elements; they must exist on the page at the time your code makes the call to .on(). To ensure the elements are present and can be selected, perform event binding inside a document ready handler for elements that are in the HTML markup on the page. If new HTML is being injected into the page, select the elements and attach event handlers after the new HTML is placed into the page. Or, use delegated events to attach an event handler, as described next.

    so maybe once the tribe-events div gets replaced by ajax, the event handler is destroyed. I’ll see if i can provide an example page with the original code, but I don’t want to revert the actual page with the calendar because it works correctly with my change.

    See, in tribe-events-ajax-calendar.js, there’s this line:
    $('#tribe-events-content').replaceWith($the_content);

    and #tribe-events-content contains #tribe-events so it’s *not* persistent.

    Hey there yitwail, thanks for reporting back! OK, we definitely have an issue somewhere here, I appreciate you reporting this.

    The div with an id of #tribe-events should most definitely be outside of ajax, it is something we inject with php before any other events output begins.

    I am talking about a div that should look something like this in the markup: <div id="tribe-events" class="tribe-no-js" data-live_ajax="1" data-category="">

    Are we talking about the same thing? If so, and it truly is being incorrectly included *inside* #tribe-events-content then we have a bug I may need to patch. As said though i do not see this issue in my local nor have we had any other reports of this, so it would seem to be something exclusive to your install or a particular configuration?

    Would you mind sharing a link to the install? Or if not, could you tell me theme, events template and plugins in use so i can try to recreate and get a fix out if it turns out its something I can patch?

    Thanks so much, and sorry for any trouble again!

    Thread Starter yitwail

    (@yitwail)

    Ok, here’s the link, but this is a test site so it may not last indefinitely:

    http://yitwail.webfactional.com/blog/our-calendar/

    Maybe the issue is that I’m extensively customizing it to meet client requirements. For instance, there’s no tab to switch from calendar to list of events. In the theme’s tribe-events calendar, I have custom default-template.php, month.php, single-event.php, list/single-event.php, month/content.php, and month/single-day.php

    Thanks for sharing that yitwail, that’s definitely a problem. that div is injecting in the incorrect place. it should always be injecting as our absolutely outermost container. So the issue is not with the javascript but rather something to do with that function and your customizations.

    I could check into this. the quickest way would be to get a copy of the customized files so i could take a look. if you feel like doing that you can hit up my gmail at cthulhumythos /a/ gmail.com

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Great functionality’ is closed to new replies.