Advertisement
BakerMan

TEC Calendar Widget: Make Custom Tax Persist

Nov 29th, 2012
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * This is an amended version of events-mini-ajax.js to support persistent
  3.  * categories.
  4.  *
  5.  * @see http://tri.be/support/forums/topic/calendar-widget-with-different-categories-for-different-pages/
  6.  */
  7. jQuery(document).ready(function($) {
  8.     $('#calendar_wrap .tribe-mini-ajax').live( 'click', function(e){
  9.         e.preventDefault();
  10.         var month_target = $(this).attr("data-month");
  11.         var params = {
  12.             action: 'calendar-mini',
  13.             eventDate: month_target,
  14.             customCalendarWidgetTax: $("input[name=customCalendarWidgetTax]").val()
  15.         };
  16.         $("#tribe-mini-ajax-month").hide();
  17.         $("#ajax-loading-mini").show();
  18.         $.post(
  19.             TribeMiniCalendar.ajaxurl,
  20.             params,
  21.             function ( response ) {
  22.                 $("#ajax-loading-mini").hide();
  23.                 $("#tribe-mini-ajax-month").show();
  24.                 $("#calendar_wrap").html( response );
  25.             }
  26.         );
  27.     });
  28. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement