diff options
Diffstat (limited to 'extensions/BugModal/web/bug_modal.js')
-rw-r--r-- | extensions/BugModal/web/bug_modal.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/extensions/BugModal/web/bug_modal.js b/extensions/BugModal/web/bug_modal.js index 6c10c6fb0..6c72eb249 100644 --- a/extensions/BugModal/web/bug_modal.js +++ b/extensions/BugModal/web/bug_modal.js @@ -949,6 +949,19 @@ $(function() { $('#' + id).datetimepicker('show'); }); + // timetracking + $('#work_time').change(function() { + // subtracts time spent from remaining time + // prevent negative values if work_time > fRemainingTime + var new_time = Math.max(BUGZILLA.remaining_time - $('#work_time').val(), 0.0); + // get upto 2 decimal places + $('#remaining_time').val(Math.round((new_time * 100)/100).toFixed(1)); + }); + $('#remaining_time').change(function() { + // if the remaining time is changed manually, update BUGZILLA.remaining_time + BUGZILLA.remaining_time = $('#remaining_time').val(); + }); + // new bug button $.contextMenu({ selector: '#new-bug-btn', |