Focus the first text input or submit button when showing a modal box.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8873 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
a5037783d4
commit
0729ee143b
|
@ -314,10 +314,11 @@ function showModal(id, width) {
|
|||
el.addClassName('modal');
|
||||
el.show();
|
||||
|
||||
var submit = el.down("input[type=submit]");
|
||||
if (submit) {
|
||||
submit.focus();
|
||||
}
|
||||
if (el.down("input[type=text]")) {
|
||||
el.down("input[type=text]").focus();
|
||||
} else if (el.down("input[type=submit]")) {
|
||||
el.down("input[type=submit]").focus();
|
||||
}
|
||||
}
|
||||
|
||||
function hideModal(el) {
|
||||
|
|
Loading…
Reference in New Issue