summaryrefslogtreecommitdiffstats
path: root/extensions/BugModal/web
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
parent35b33fe133ff1284de0f33b2da4f132d3e7c8287 (diff)
downloadbugzilla-73fffe57d7604cd711a26130514aceeac12facb8.tar.gz
bugzilla-73fffe57d7604cd711a26130514aceeac12facb8.tar.xz
Bug 1149384 - implement time tracking interface
Diffstat (limited to 'extensions/BugModal/web')
-rw-r--r--extensions/BugModal/web/bug_modal.css6
-rw-r--r--extensions/BugModal/web/bug_modal.js13
2 files changed, 19 insertions, 0 deletions
diff --git a/extensions/BugModal/web/bug_modal.css b/extensions/BugModal/web/bug_modal.css
index 0a589b050..88ffadc9e 100644
--- a/extensions/BugModal/web/bug_modal.css
+++ b/extensions/BugModal/web/bug_modal.css
@@ -109,6 +109,9 @@ a.activity-ref {
background: #eee;
padding: 2px 5px;
cursor: pointer;
+ -webkit-box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.1);
+ -moz-box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.1);
+ box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.1);
}
.module-header:hover {
@@ -158,6 +161,9 @@ a.activity-ref {
.module-content {
padding: 2px 5px;
background: #fff;
+ -webkit-box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.1);
+ -moz-box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.1);
+ box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.1);
}
.module .field {
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',