Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * This is an amended version of events-mini-ajax.js to resolve the tooltip
- * issue raised by Louise.
- *
- * Before using, backup the original code!
- *
- * @see http://tri.be/support/forums/topic/events-calendar-widget-right-tooltip-no-longer-aligning-after-navigating/
- */
- jQuery(document).ready(function($) {
- /**
- * This is effectively the same function as defined in events.js,
- * however it cannot be reached from within this function so we'll
- * replicate it here as a workaround.
- */
- function tribe_event_nudge() {
- // prepare calendar for popups
- $('table.tribe-events-calendar tbody tr, table.tribe-events-grid tr.tribe-week-events-row').each(function() {
- // add a class of "tribe-events-right" to last 3 days of week so tooltips stay onscreen. To be replaced by php.
- $(this).find('td:gt(3)').addClass('tribe-events-right');
- });
- }
- // handler for tribe events calendar widget ajax call. jquery 1.4 minimum
- $('#calendar_wrap .tribe-mini-ajax').live( 'click', function(e){
- e.preventDefault();
- var month_target = $(this).attr("data-month");
- var params = {
- action: 'calendar-mini',
- eventDate: month_target
- };
- $("#tribe-mini-ajax-month").hide();
- $("#ajax-loading-mini").show();
- $.post(
- TribeMiniCalendar.ajaxurl,
- params,
- function ( response ) {
- $("#ajax-loading-mini").hide();
- $("#tribe-mini-ajax-month").show();
- $("#calendar_wrap").html( response );
- // Let's nudge the tooltips back into line
- tribe_event_nudge();
- }
- );
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement