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
7d945d65
Commit
7d945d65
authored
Apr 11, 2012
by
Frédéric Buclin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 734997: The 'take' link for the assignee field doesn't work when usemenuforusers is turned on
r=glob a=LpSolit
parent
6a83a1dd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
7 deletions
+22
-7
field.js
js/field.js
+22
-7
No files found.
js/field.js
View file @
7d945d65
...
...
@@ -205,12 +205,12 @@ function setupEditLink(id) {
hideEditableField
(
link_container
,
input_container
,
link
);
}
/* Hide input
fields and show the text with (edit) next to it */
/* Hide input
/select fields and show the text with (edit) next to it */
function
hideEditableField
(
container
,
input
,
action
,
field_id
,
original_value
,
new_value
)
{
YAHOO
.
util
.
Dom
.
removeClass
(
container
,
'bz_default_hidden'
);
YAHOO
.
util
.
Dom
.
addClass
(
input
,
'bz_default_hidden'
);
YAHOO
.
util
.
Event
.
addListener
(
action
,
'click'
,
showEditableField
,
new
Array
(
container
,
input
,
new_value
));
new
Array
(
container
,
input
,
field_id
,
new_value
));
if
(
field_id
!=
""
){
YAHOO
.
util
.
Event
.
addListener
(
window
,
'load'
,
checkForChangedFieldValues
,
new
Array
(
container
,
input
,
field_id
,
original_value
));
...
...
@@ -218,13 +218,14 @@ function hideEditableField( container, input, action, field_id, original_value,
}
/* showEditableField (e, ContainerInputArray)
* Function hides the (edit) link and the text and displays the input
* Function hides the (edit) link and the text and displays the input
/select field
*
* var e: the event
* var ContainerInputArray: An array containing the (edit) and text area and the input being displayed
* var ContainerInputArray[0]: the container that will be hidden usually shows the (edit) or (take) text
* var ContainerInputArray[1]: the input area and label that will be displayed
* var ContainerInputArray[2]: the new value to set the input field to when (take) is clicked
* var ContainerInputArray[2]: the input/select field id for which the new value must be set
* var ContainerInputArray[3]: the new value to set the input/select field to when (take) is clicked
*/
function
showEditableField
(
e
,
ContainerInputArray
)
{
var
inputs
=
new
Array
();
...
...
@@ -237,18 +238,32 @@ function showEditableField (e, ContainerInputArray) {
YAHOO
.
util
.
Dom
.
removeClass
(
inputArea
,
'bz_default_hidden'
);
if
(
inputArea
.
tagName
.
toLowerCase
()
==
"input"
)
{
inputs
.
push
(
inputArea
);
}
else
if
(
ContainerInputArray
[
2
])
{
inputs
.
push
(
document
.
getElementById
(
ContainerInputArray
[
2
]));
}
else
{
inputs
=
inputArea
.
getElementsByTagName
(
'input'
);
}
if
(
inputs
.
length
>
0
)
{
// Change the first field's value to ContainerInputArray[2]
// if present before focusing.
if
(
ContainerInputArray
[
2
])
{
inputs
[
0
].
value
=
ContainerInputArray
[
2
];
var
type
=
inputs
[
0
].
tagName
.
toLowerCase
();
if
(
ContainerInputArray
[
3
])
{
if
(
type
==
"input"
)
{
inputs
[
0
].
value
=
ContainerInputArray
[
3
];
}
else
{
for
(
var
i
=
0
;
inputs
[
0
].
length
;
i
++
)
{
if
(
inputs
[
0
].
options
[
i
].
value
==
ContainerInputArray
[
3
]
)
{
inputs
[
0
].
options
[
i
].
selected
=
true
;
break
;
}
}
}
}
// focus on the first field, this makes it easier to edit
inputs
[
0
].
focus
();
inputs
[
0
].
select
();
if
(
type
==
"input"
)
{
inputs
[
0
].
select
();
}
}
YAHOO
.
util
.
Event
.
preventDefault
(
e
);
}
...
...
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