1bez.ctl.task = function() { 2 var $task_form = jQuery('.bez_task_form'); 3 4 if ($task_form.length > 0) { 5 //date picker 6 jQuery("input[name=plan_date]").datepicker({ 7 dateFormat: "yy-mm-dd" 8 }); 9 if (jQuery("input[name=all_day_event]").is(":checked")) { 10 jQuery('#task_datapair').hide(); 11 } 12 jQuery("input[name=all_day_event]").on('change', function() { 13 if (jQuery(this).is(":checked")) { 14 jQuery('#task_datapair').hide(); 15 } else { 16 jQuery('#task_datapair').show(); 17 } 18 }); 19 20 //time picker 21 jQuery('#task_datapair .time').timepicker({ 22 'showDuration': true, 23 'timeFormat': 'H:i' 24 }); 25 var timeDatepair = new Datepair(jQuery('#task_datapair').get(0)); 26 bez.rich_text_editor($task_form.find('textarea'), $task_form.find('.bez_toolbar')); 27 } 28 29 if (jQuery('#reason').length > 0) { 30 jQuery('#no_evaluation').on('change', function() { 31 if (jQuery(this).prop('checked') === true) { 32 jQuery('#reason').prop('disabled', true).hide(); 33 jQuery('.bez_reason_toolbar').hide(); 34 } else { 35 jQuery('#reason').prop('disabled', false).show(); 36 jQuery('.bez_reason_toolbar').show(); 37 } 38 39 }); 40 bez.rich_text_editor(jQuery('#reason'), jQuery('.bez_reason_toolbar')); 41 } 42 43 jQuery('#bez_hidden_issue').hide(); 44 jQuery('#bez_show_issue').on('click', function (e) { 45 e.preventDefault(); 46 jQuery('#bez_hidden_issue').slideDown(); 47 jQuery(this).hide(); 48 }); 49};