summaryrefslogtreecommitdiffstats
path: root/public
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2014-01-19 08:57:47 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2014-01-19 08:57:47 +0000
commitbacc2508161ac0f47f153766627472b639c7484c (patch)
tree11c53d7b6f8d598c026320b73be419efc9112718 /public
parent6f1cda4852fdf04be23e77825ffcdb1a22b913a7 (diff)
downloadredmine-bacc2508161ac0f47f153766627472b639c7484c.tar.gz
redmine-bacc2508161ac0f47f153766627472b639c7484c.zip
Focus first text field automatically (#13134).
git-svn-id: http://svn.redmine.org/redmine/trunk@12670 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'public')
-rw-r--r--public/javascripts/application.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/public/javascripts/application.js b/public/javascripts/application.js
index a6d15f2f0..f31cb353a 100644
--- a/public/javascripts/application.js
+++ b/public/javascripts/application.js
@@ -583,6 +583,12 @@ function addFormObserversForDoubleSubmit() {
});
}
+function defaultFocus(){
+ if ($('#content :focus').length == 0) {
+ $('#content input[type=text], #content textarea').first().focus();
+ }
+}
+
function blockEventPropagation(event) {
event.stopPropagation();
event.preventDefault();
@@ -604,4 +610,5 @@ $(document).ready(function(){
$(document).ready(setupAjaxIndicator);
$(document).ready(hideOnLoad);
$(document).ready(addFormObserversForDoubleSubmit);
+$(document).ready(defaultFocus);