diff options
author | David Lawrence <dkl@mozilla.com> | 2016-05-20 19:17:18 +0200 |
---|---|---|
committer | David Lawrence <dkl@mozilla.com> | 2016-05-20 19:17:18 +0200 |
commit | 73fffe57d7604cd711a26130514aceeac12facb8 (patch) | |
tree | 1051c3e92c3b2bfca4381149d2a02d6e4daec5e2 /extensions/BugModal/web/bug_modal.js | |
parent | 35b33fe133ff1284de0f33b2da4f132d3e7c8287 (diff) | |
download | bugzilla-73fffe57d7604cd711a26130514aceeac12facb8.tar.gz bugzilla-73fffe57d7604cd711a26130514aceeac12facb8.tar.xz |
Bug 1149384 - implement time tracking interface
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', |