summaryrefslogtreecommitdiffstats
path: root/extensions/BugModal/web/bug_modal.js
diff options
context:
space:
mode:
authorDavid Lawrence <dkl@mozilla.com>2016-05-20 19:17:18 +0200
committerDavid Lawrence <dkl@mozilla.com>2016-05-20 19:17:18 +0200
commit73fffe57d7604cd711a26130514aceeac12facb8 (patch)
tree1051c3e92c3b2bfca4381149d2a02d6e4daec5e2 /extensions/BugModal/web/bug_modal.js
parent35b33fe133ff1284de0f33b2da4f132d3e7c8287 (diff)
downloadbugzilla-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.js13
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',