Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
14297c3f
Commit
14297c3f
authored
Mar 10, 2014
by
Ishitva Goel
Committed by
Frédéric Buclin
Mar 10, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 566331: Move JS functions out of bug/edit.html.tmpl
r=LpSolit a=justdave
parent
cd4b2663
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
17 deletions
+14
-17
field.js
js/field.js
+13
-0
edit.html.tmpl
template/en/default/bug/edit.html.tmpl
+1
-17
No files found.
js/field.js
View file @
14297c3f
...
...
@@ -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
;
}
template/en/default/bug/edit.html.tmpl
View file @
14297c3f
...
...
@@ -36,23 +36,7 @@
<script type="text/javascript">
<!--
[% IF user.is_timetracker %]
var fRemainingTime = [% bug.remaining_time %]; // holds the original value
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;
}
var bz_remaining_time = [% bug.remaining_time %];
[% END %]
[% IF user.id %]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment