diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-02-14 15:28:30 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-02-14 15:28:30 +0000 |
commit | 0729ee143bc4f3efedcd4f9dfa775e02b52ad5f0 (patch) | |
tree | c29d231b386cd7137c320aff618954b28005fb32 /public/javascripts/application.js | |
parent | a5037783d4d1ce92e7ff60b5adb31e125bba092d (diff) | |
download | redmine-0729ee143bc4f3efedcd4f9dfa775e02b52ad5f0.tar.gz redmine-0729ee143bc4f3efedcd4f9dfa775e02b52ad5f0.zip |
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
Diffstat (limited to 'public/javascripts/application.js')
-rw-r--r-- | public/javascripts/application.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 2c4910c44..fdafc9899 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -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) { |