1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Redmine のリポジトリページを開いた時にリビジョン入力欄を選択させないようにする

Posted at

環境

  • Redmine 3.2.1
  • Firefox 46.0.1

問題

例えば、以下のようなページの途中 (ファイルの 641 行目) へのリンクの場合、

ページを開いたら該当の場所が表示されて欲しいが、リビジョンの入力欄が選択されて以下の図ようにページの先頭付近が表示されてしまう。

Screen Shot 2016-06-09 at 00.35.43.png

この例に対しては以下で修正された模様。しかし自分の環境では相変わらず発生する。

また、この例のようなページの途中へのリンクでなくても、バックスペースキーで戻ったりスペースキーでスクロールしたりしたいので、入力欄が選択されるのは困る。

修正

--- a/redmine-3.2.1/public/javascripts/application.js	2016-06-09 00:31:47.825000000 +0900
+++ b/redmine-3.2.1/public/javascripts/application.js	2016-06-09 00:41:30.878000000 +0900
@@ -640,7 +640,7 @@
 
 function defaultFocus(){
   if (($('#content :focus').length == 0) && (window.location.hash == '')) {
-    $('#content input[type=text], #content textarea').first().focus();
+    $('#content input[type=text], #content textarea').not('.contextual *').first().focus();
   }
 }
 

これで期待通りになった。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?