Add ability for no comment when workTime is null

parent ead64239
......@@ -187,10 +187,10 @@ window.addEventListener("load", function() {
workTime === parseInt(btn.dataset["time"])
? parseInt(btn.dataset["time"])
: workTime;
workTime = workTime > 0 ? workTime : 1;
workTime = workTime > 0 ? workTime : 0;
let workTimeValue = Math.ceil((workTime / 60) * 100) / 100;
let productiveTime = parseInt(document.querySelector("#ProductTime").value);
productiveTime = productiveTime > 0 ? productiveTime : 1;
productiveTime = productiveTime > 0 ? productiveTime : 0;
let productiveTimeValue = Math.ceil((productiveTime / 60) * 100) / 100;
document.querySelector("#work_time").value = workTimeValue;
document.querySelector("#productive_time").value = productiveTimeValue;
......@@ -223,6 +223,11 @@ window.addEventListener("load", function() {
timer.clear();
localStorage.removeItem("time");
}
} else if (!comment.length && workTimeValue === 0 && productiveTimeValue === 0) {
let bugForm = etersoft_create === 1 ? "#Create" : "#changeform";
document.querySelector(bugForm).submit();
timer.clear();
localStorage.removeItem("time");
} else {
alert("Поле комментария не может быть пустым!");
}
......
......@@ -46,4 +46,4 @@
<script language="javascript" type="text/javascript" src="js/etersoft/focusManager.js"></script>
<script language="javascript" type="text/javascript" src="js/etersoft/timer_common.js?25_10_2017"></script>
<script language="javascript" type="text/javascript" src="js/etersoft/timer.js?11_09_2020"></script>
<script language="javascript" type="text/javascript" src="js/etersoft/timer.js?11_09_2020_"></script>
......@@ -46,4 +46,4 @@
<script language="javascript" type="text/javascript" src="js/etersoft/focusManager.js"></script>
<script language="javascript" type="text/javascript" src="js/etersoft/timer_common.js?25_10_2017"></script>
<script language="javascript" type="text/javascript" src="js/etersoft/timer.js?11_09_2020"></script>
<script language="javascript" type="text/javascript" src="js/etersoft/timer.js?11_09_2020_"></script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment