aboutsummaryrefslogtreecommitdiffstats
path: root/view/js/mod_cal.js
blob: 5867f676e9928a677d47eda165d6d99783d8e6c0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/**
 * JavaScript for mod/cal
 */

$(document).ready( function() {
	$(document).on('click','#fullscreen-btn', on_fullscreen);
	$(document).on('click','#inline-btn', on_inline);
});

function on_fullscreen() {
	var view = $('#events-calendar').fullCalendar('getView');
	if(view.type === 'month') {
		$('#events-calendar').fullCalendar('option', 'height', $(window).height() - $('.section-title-wrapper').outerHeight(true) - 2); // -2 is for border width (top and bottom) of .generic-content-wrapper
	}
}

function on_inline() {
	var view = $('#events-calendar').fullCalendar('getView');
	if(view.type === 'month') {
		$('#events-calendar').fullCalendar('option', 'height', '');
	}
}