From 8924f94d05fcbe6a34bb46d7bb4b2ba63ac78da2 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 16 Jun 2016 12:21:59 +0200 Subject: show month view in full height in fullscreen view --- view/js/mod_cal.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 view/js/mod_cal.js (limited to 'view/js/mod_cal.js') diff --git a/view/js/mod_cal.js b/view/js/mod_cal.js new file mode 100644 index 000000000..0bf97fcf7 --- /dev/null +++ b/view/js/mod_cal.js @@ -0,0 +1,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', 'auto'); + } +} -- cgit v1.2.3