summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2022-09-28 09:18:31 +0000
committerGo MAEDA <maeda@farend.jp>2022-09-28 09:18:31 +0000
commitdf88b9c7ddb485784b1c74c40e7b34675d68f983 (patch)
treee2a2bbb9c64f3db2284e0ac686af5f40d00483a4
parent16c2c4a8808981bf4b34864a1ed56f61723466cf (diff)
downloadredmine-df88b9c7ddb485784b1c74c40e7b34675d68f983.tar.gz
redmine-df88b9c7ddb485784b1c74c40e7b34675d68f983.zip
Issue ID field does not get focus when adding a related issue (#37473).
Patch by Mizuki ISHIKAWA. git-svn-id: https://svn.redmine.org/redmine/trunk@21867 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/helpers/application_helper.rb2
-rw-r--r--public/javascripts/application.js2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 70634f6ab..ced1845eb 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -336,7 +336,7 @@ module ApplicationHelper
def toggle_link(name, id, options={})
onclick = +"$('##{id}').toggle(); "
- onclick << (options[:focus] ? "$('##{options[:focus]}').focus(); " : "this.blur(); ")
+ onclick << (options[:focus] ? "$('##{options[:focus]}:visible').focus(); " : "this.blur(); ")
onclick << "$(window).scrollTop($('##{options[:focus]}').position().top); " if options[:scroll]
onclick << "return false;"
link_to(name, "#", :onclick => onclick)
diff --git a/public/javascripts/application.js b/public/javascripts/application.js
index 91da19229..4d039cde1 100644
--- a/public/javascripts/application.js
+++ b/public/javascripts/application.js
@@ -958,7 +958,7 @@ function addFormObserversForDoubleSubmit() {
function defaultFocus(){
if (($('#content :focus').length == 0) && (window.location.hash == '')) {
- $('#content input[type=text], #content textarea').first().focus();
+ $('#content input[type=text]:visible, #content textarea:visible').first().focus();
}
}