From 3397f042587d71d27aa7d3e08d4e38f93a278636 Mon Sep 17 00:00:00 2001 From: Leonhard Brunner Date: Mon, 16 Aug 2021 20:38:52 +0200 Subject: [PATCH] ATLDEV-325 The target total hours should not be editable by the users --- src/main/resources/js/timesheet/functions.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/resources/js/timesheet/functions.js b/src/main/resources/js/timesheet/functions.js index a9439d3a..183fc3e8 100644 --- a/src/main/resources/js/timesheet/functions.js +++ b/src/main/resources/js/timesheet/functions.js @@ -80,11 +80,6 @@ function initTimesheetInformationValues(timesheetData) { AJS.$("#timesheet-hours-remain").val(toFixed(timesheetData.targetHours - AJS.$("#timesheet-hours-practical").val() - timesheetData.targetHoursRemoved, 2)); - AJS.$("#edit-total-hours").on("click", function (e) { - AJS.$("#timesheet-hours-text").removeAttr("disabled"); - AJS.$("#submit-total-hours").css("visibility" , "visible"); - }); - AJS.$("#submit-total-hours").on("click", function (e) { console.log("submitting new total hours"); var value; @@ -170,7 +165,13 @@ function initTimesheetInformationValues(timesheetData) { //load values AJS.$("#timesheet-substract-hours-text").val(timesheetData.reason); AJS.$("#timesheet-hours-substract").val(toFixed(timesheetData.targetHoursRemoved, 2)); + + AJS.$("#edit-total-hours").on("click", function (e) { + AJS.$("#timesheet-hours-text").removeAttr("disabled"); + AJS.$("#submit-total-hours").css("visibility" , "visible"); + }); } else { + AJS.$("#edit-total-hours").hide(); AJS.$("#substractTimesheetHours").empty(); AJS.$("#substractTimesheetHours").append("
"); AJS.$("#substractTimesheetHours").append("");