]> source.dussan.org Git - redmine.git/commitdiff
Moves thumbnail title attribute from `a` to `img` (#41272).
authorGo MAEDA <maeda@farend.jp>
Fri, 20 Sep 2024 10:24:53 +0000 (10:24 +0000)
committerGo MAEDA <maeda@farend.jp>
Fri, 20 Sep 2024 10:24:53 +0000 (10:24 +0000)
Patch by Jens Krämer (user:jkraemer).

git-svn-id: https://svn.redmine.org/redmine/trunk@23065 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/application_helper.rb
test/helpers/application_helper_test.rb

index 7e13c995ca1d2f07f77023c774e5fc2054c00802..b116190888a6a65b5c173b23dcffaeb736a7db09 100644 (file)
@@ -351,12 +351,12 @@ module ApplicationHelper
         thumbnail_path,
         :srcset => "#{thumbnail_path} 2x",
         :style => "max-width: #{thumbnail_size}px; max-height: #{thumbnail_size}px;",
+        :title => attachment.filename,
         :loading => "lazy"
       ),
       attachment_path(
         attachment
-      ),
-      :title => attachment.filename
+      )
     )
   end
 
index 76b39545ce0758392bf22a520136048140cd6e15..bad102c20a03b78fba73c0fc9f9910d78121f29e 100644 (file)
@@ -1932,7 +1932,7 @@ class ApplicationHelperTest < Redmine::HelperTest
     a = Attachment.find(3)
     assert_select_in(
       thumbnail_tag(a),
-      'a[href=?][title=?] img[src=?][loading="lazy"]',
+      'a[href=?] img[title=?][src=?][loading="lazy"]',
       "/attachments/3", "logo.gif", "/attachments/thumbnail/3/200")
   end