/************************************* * SPDX-FileCopyrightText: 2009-2020 Vtenext S.r.l. * SPDX-License-Identifier: AGPL-3.0-only ************************************/ function edittaskscript($){ function NumberBox(element){ var elementId = element.attr("id"); var boxId = '#'+elementId+'-number-box'; var str = ""; for(var i = 1; i <= 30; i++){ str += ''+(i < 10? ("0"+i) : i)+' '; if(!(i % 5)){ str+="
"; } } element.after(''); element.focus(function(){ var pos = element.position(); $(boxId).css('display', 'block'); $(boxId).css({ position: 'absolute', top: (pos.top+25)+'px' }); }); element.blur(function(){ setTimeout(function(){$(boxId).css('display', 'none');},500); }); $('.box_cel').click(function(){ element.val(parseInt($(this).text(), 10)); }); } $(document).ready(function(){ validator = new VTFieldValidator($('#new_task_form')); validator.mandatoryFields = ['summary']; $('.time_field').timepicker(); NumberBox($('#select_date_days')); //UI to set the date for executing the task. $('#check_select_date').click(function(){ if($(this).prop('checked')){ $('#select_date').css('display', 'block'); }else{ $('#select_date').css('display', 'none'); } }); $('#edittask_cancel_button').click(function(){ window.location=returnUrl; }); }); }