diff --git a/app/views/dmsf_files/_links.html.erb b/app/views/dmsf_files/_links.html.erb
index c9b193e4..38b139bd 100644
--- a/app/views/dmsf_files/_links.html.erb
+++ b/app/views/dmsf_files/_links.html.erb
@@ -28,6 +28,6 @@
<% links.each do |dmsf_file, link, create_at| %>
<%= render :partial => 'dmsf_files/link', :locals => { :dmsf_file => dmsf_file, :link => link } %>
<% end %>
- <%= render :partial => 'dmsf_files/thumbnails', :locals => { :links => links, :thumbnails => thumbnails } %>
+ <%= render :partial => 'dmsf_files/thumbnails', :locals => { :links => links, :thumbnails => thumbnails, :link_to => true } %>
<% end %>
diff --git a/app/views/dmsf_files/_thumbnails.html.erb b/app/views/dmsf_files/_thumbnails.html.erb
index c576f14f..3e545d58 100644
--- a/app/views/dmsf_files/_thumbnails.html.erb
+++ b/app/views/dmsf_files/_thumbnails.html.erb
@@ -27,9 +27,12 @@
<% images.each do |file| %>
- <%= link_to image_tag(dmsf_thumbnail_path(file)),
- url_for({:controller => :dmsf_files, :action => 'view', :id => file}),
- :alt => file.title %>
+ <% if link_to # Redmine classic %>
+ <%= link_to image_tag(dmsf_thumbnail_path(file)), view_dmsf_file_path(file), :alt => file.title %>
+ <% else # jQuery gallery %>
+ <%= image_tag(dmsf_thumbnail_path(file),
+ { :'data-fullsrc' => view_dmsf_file_path(file), :alt => file.title }) %>
+ <% end %>
<% end %>
diff --git a/lib/redmine_dmsf/hooks/views/issue_view_hooks.rb b/lib/redmine_dmsf/hooks/views/issue_view_hooks.rb
index cb29ab70..6f0d80fd 100644
--- a/lib/redmine_dmsf/hooks/views/issue_view_hooks.rb
+++ b/lib/redmine_dmsf/hooks/views/issue_view_hooks.rb
@@ -78,7 +78,7 @@ module RedmineDmsf
if links.present?
html = controller.send(:render_to_string,
{ :partial => 'dmsf_files/thumbnails',
- :locals => { :links => links, :thumbnails => Setting.thumbnails_enabled?} })
+ :locals => { :links => links, :thumbnails => Setting.thumbnails_enabled?, :link_to => false } })
html.html_safe
end
end