summaryrefslogtreecommitdiff
path: root/public/js/calendar.js
blob: 57d9095bd67f6deb818f6ed4566edaaba0d8476c (plain)
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
var hide_events = function() {
	$('.tabcalendar-event-details').hide();
};
var show_event = function(event_id) {
	hide_events();
	$('.tabcalendar-event-details' + event_id).show();
};

$(function() {
	$('.calendar-listing>p').click(function() {
		$(this).next().toggle('fast');
		return false;
	}).next().hide();
	$('.tabcal-cell a').each(function(i,a) {
		var hashpos = a.href.indexOf('#');
		if (hashpos < 0)
			return true;
		var hash = a.href.slice(hashpos);
		if (!hash.startsWith('#event-'))
			return true;
		a.onclick = function() {
			show_event(hash);
			return true;
		};
	});
	hide_events();
});