mc-ajax.js
2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
(function ($) {
'use strict';
$(function () {
$(document).on('click', '.calendar .my-calendar-nav a', function (e) {
e.preventDefault();
var link = $(this).attr('href');
var height = $('.mc-main.calendar' ).height();
var ref = $(this).attr('data-rel');
$('#' + ref).html('<div class=\"mc-loading\"></div><div class=\"loading\" style=\"height:' + height + 'px\"><span class="screen-reader-text">Loading...</span></div>');
$('#' + ref).load(link + ' #' + ref + ' > *', function () {
$('.calendar-event').children().not('.event-title').hide();
$('#' + ref).attr('tabindex', '-1').focus();
});
});
$(document).on('click', '.list .my-calendar-nav a', function (e) {
e.preventDefault();
var link = $(this).attr('href');
var ref = $(this).attr('data-rel');
var height = $('.mc-main.list' ).height();
$('#' + ref).html('<div class=\"mc-loading\"></div><div class=\"loading\" style=\"height:' + height + 'px\"><span class="screen-reader-text">Loading...</span></div>');
$('#' + ref).load(link + ' #' + ref + ' > *', function () {
$('li.mc-events').children().not('.event-date').hide();
$('li.current-day').children().show();
$('#' + ref).attr('tabindex', '-1').focus();
});
});
$(document).on('click', '.mini .my-calendar-nav a', function (e) {
e.preventDefault();
var link = $(this).attr('href');
var ref = $(this).attr('data-rel');
var height = $('.mc-main.mini' ).height();
$('#' + ref).html('<div class=\"mc-loading\"></div><div class=\"loading\" style=\"height:' + height + 'px\"><span class="screen-reader-text">Loading...</span></div>');
$('#' + ref).load(link + ' #' + ref + ' > *', function () {
$('.mini .has-events').children().not('.trigger, .mc-date, .event-date').hide();
$('#' + ref).attr('tabindex', '-1').focus();
});
});
});
}(jQuery));