diff --git a/app/views/attachments/_links.html.erb b/app/views/attachments/_links.html.erb
index 8254367..4d90b3b 100644
--- a/app/views/attachments/_links.html.erb
+++ b/app/views/attachments/_links.html.erb
@@ -22,7 +22,7 @@
:class => 'icon-only icon-magnifier lightbox_preview ' + attachment.filename.split('.').last.downcase,
:rel => 'attachments', :title => "#{attachment.filename}#{ (' - ' + attachment.description) unless attachment.description.blank? }" %>
<% end %>
- <% if( attachment.filename =~ /.(pdf|swf)$/i ) %>
+ <% if attachment.is_pdf? %>
<%= link_to l(:button_view),
{ :controller => 'attachments', :action => 'download_inline',
:id => attachment, :filename => attachment.filename },
@@ -54,7 +54,7 @@
<%=
link_to image_tag(url_for(:controller => 'attachments', :action => 'thumbnail', :id => attachment)),
{:controller => 'attachments', :action => 'download', :id => attachment, :filename => attachment.filename},
- :class => 'lightbox', :rel => 'thumbnails', :title => "#{attachment.filename}#{ ('-' + attachment.description) unless attachment.description.blank? }"
+ :class => ('lightbox' + (attachment.is_pdf? ? ' pdf' : '')) , :rel => 'thumbnails', :title => "#{attachment.filename}#{ ('-' + attachment.description) unless attachment.description.blank? }"
%>
<% end %>
diff --git a/assets/javascripts/lightbox.js b/assets/javascripts/lightbox.js
index 1b7b3ea..860d9ca 100644
--- a/assets/javascripts/lightbox.js
+++ b/assets/javascripts/lightbox.js
@@ -40,7 +40,12 @@ $(document).ready(function() {
closeSpeed : 150
});
- $("div.attachments a.pdf").fancybox({
+ $("div.attachments a.pdf," +
+ "div.journal ul.details a[href$='.pdf']," +
+ "div.journal ul.details a[href$='.PDF']," +
+ "div.journal div.thumbnails a[href$='.pdf']," +
+ "div.journal div.thumbnails a[href$='.PDF']").fancybox({
+ type : 'iframe',
prevEffect : 'none',
nextEffect : 'none',
openSpeed : 300,
diff --git a/init.rb b/init.rb
index f3f5ebb..dc79395 100644
--- a/init.rb
+++ b/init.rb
@@ -9,7 +9,7 @@
description 'This plugin lets you preview image, pdf and swf attachments in a lightbox.'
version '0.3.2'
url 'https://github.com/paginagmbh/redmine_lightbox2'
- requires_redmine :version_or_higher => '3.3.0'
+ requires_redmine :version_or_higher => '3.2.0'
end