From: Ishitva Goel Date: Mon, 10 Mar 2014 14:08:57 +0000 (+0100) Subject: Bug 566331: Move JS functions out of bug/edit.html.tmpl X-Git-Tag: bugzilla-4.5.3~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=14297c3f99da39acf42f359247f68f754da03fca;p=thirdparty%2Fbugzilla.git Bug 566331: Move JS functions out of bug/edit.html.tmpl r=LpSolit a=justdave --- diff --git a/js/field.js b/js/field.js index 51fd1fe86e..892c8669f6 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; +} diff --git a/template/en/default/bug/edit.html.tmpl b/template/en/default/bug/edit.html.tmpl index 3a2a81d8e0..61fa2c1ec6 100644 --- a/template/en/default/bug/edit.html.tmpl +++ b/template/en/default/bug/edit.html.tmpl @@ -36,23 +36,7 @@