Bug 566331: Move JS functions out of bug/edit.html.tmpl
r=LpSolit a=justdave git-svn-id: svn://10.0.0.236/trunk@265280 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
6100eae86a
commit
16e73e51ca
@ -1 +1 @@
|
|||||||
8954
|
8955
|
||||||
@ -1070,3 +1070,16 @@ function show_comment_edit() {
|
|||||||
YAHOO.util.Dom.addClass(comment_tab, 'active_comment_tab');
|
YAHOO.util.Dom.addClass(comment_tab, 'active_comment_tab');
|
||||||
comment_tab.setAttribute('aria-selected', 'true');
|
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;
|
||||||
|
}
|
||||||
|
|||||||
@ -36,23 +36,7 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
<!--
|
<!--
|
||||||
[% IF user.is_timetracker %]
|
[% IF user.is_timetracker %]
|
||||||
var fRemainingTime = [% bug.remaining_time %]; // holds the original value
|
var bz_remaining_time = [% bug.remaining_time %];
|
||||||
function adjustRemainingTime() {
|
|
||||||
// subtracts time spent from remaining time
|
|
||||||
var new_time;
|
|
||||||
|
|
||||||
// prevent negative values if work_time > fRemainingTime
|
|
||||||
new_time =
|
|
||||||
Math.max(fRemainingTime - 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 fRemainingTime
|
|
||||||
fRemainingTime = document.changeform.remaining_time.value;
|
|
||||||
}
|
|
||||||
[% END %]
|
[% END %]
|
||||||
|
|
||||||
[% IF user.id %]
|
[% IF user.id %]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user