Focus first text field automatically (#13134).

git-svn-id: http://svn.redmine.org/redmine/trunk@12670 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2014-01-19 08:57:47 +00:00
parent 6f1cda4852
commit bacc250816
5 changed files with 7 additions and 6 deletions

View File

@@ -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);