summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorIshitva Goel <ishitva.goel@yahoo.co.in>2014-03-10 15:08:57 +0100
committerFrédéric Buclin <LpSolit@gmail.com>2014-03-10 15:08:57 +0100
commit14297c3f99da39acf42f359247f68f754da03fca (patch)
treed1288bca2508abafb038fe526aacc7f8d749bcb7 /js
parentcd4b2663e6605bbc407110e89b1d06307640b740 (diff)
downloadbugzilla-14297c3f99da39acf42f359247f68f754da03fca.tar.gz
bugzilla-14297c3f99da39acf42f359247f68f754da03fca.tar.xz
Bug 566331: Move JS functions out of bug/edit.html.tmpl
r=LpSolit a=justdave
Diffstat (limited to 'js')
-rw-r--r--js/field.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/js/field.js b/js/field.js
index 51fd1fe86..892c8669f 100644
--- a/js/field.js
+++ b/js/field.js
@@ -1070,3 +1070,16 @@ function show_comment_edit() {
YAHOO.util.Dom.addClass(comment_tab, 'active_comment_tab');
comment_tab.setAttribute('aria-selected', 'true');
}
+
+function adjustRemainingTime() {
+ // subtracts time spent from remaining time
+ // prevent negative values if work_time > bz_remaining_time
+ var new_time = Math.max(bz_remaining_time - document.changeform.work_time.value, 0.0);
+ // get upto 2 decimal places
+ document.changeform.remaining_time.value = Math.round(new_time * 100)/100;
+}
+
+function updateRemainingTime() {
+ // if the remaining time is changed manually, update bz_remaining_time
+ bz_remaining_time = document.changeform.remaining_time.value;
+}