2015-03-15 21:18:59 +00:00
/ * *
* JavaScript for mod / events
* /
2014-09-06 07:37:15 +00:00
2015-11-24 13:15:28 +00:00
$ ( document ) . ready ( function ( ) {
enableDisableFinishDate ( ) ;
2016-04-09 07:24:14 +00:00
$ ( '#comment-edit-text-desc, #comment-edit-text-loc' ) . bbco _autocomplete ( 'bbcode' ) ;
2016-06-16 10:21:59 +00:00
$ ( document ) . on ( 'click' , '#fullscreen-btn' , on _fullscreen ) ;
$ ( document ) . on ( 'click' , '#inline-btn' , on _inline ) ;
2015-11-24 13:15:28 +00:00
} ) ;
2016-06-16 10:21:59 +00:00
2015-11-24 13:15:28 +00:00
function enableDisableFinishDate ( ) {
2015-03-15 21:18:59 +00:00
if ( $ ( '#id_nofinish' ) . is ( ':checked' ) )
2015-11-24 13:15:28 +00:00
$ ( '#id_finish_text' ) . prop ( "disabled" , true ) ;
2015-03-15 21:18:59 +00:00
else
2015-11-24 13:15:28 +00:00
$ ( '#id_finish_text' ) . prop ( "disabled" , false ) ;
2015-03-15 21:18:59 +00:00
}
2016-06-16 10:21:59 +00:00
function on _fullscreen ( ) {
2016-07-01 10:21:19 +00:00
$ ( '#events-calendar' ) . fullCalendar ( 'option' , 'height' , $ ( window ) . height ( ) - $ ( '.section-title-wrapper' ) . outerHeight ( true ) - 2 ) ; // -2 is for border width (.generic-content-wrapper top and bottom) of .generic-content-wrapper
2016-06-16 10:21:59 +00:00
}
function on _inline ( ) {
var view = $ ( '#events-calendar' ) . fullCalendar ( 'getView' ) ;
2016-07-01 10:21:19 +00:00
( ( view . type === 'month' ) ? $ ( '#events-calendar' ) . fullCalendar ( 'option' , 'height' , '' ) : $ ( '#events-calendar' ) . fullCalendar ( 'option' , 'height' , 'auto' ) ) ;
2016-06-16 10:21:59 +00:00
}