Skip to content

Commit

Permalink
Make the lightbox work with all pdf thumbnails
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix Schäfer committed Apr 8, 2017
1 parent 0888240 commit cd64560
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/views/attachments/_links.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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? }"
%>
</div>
<% end %>
Expand Down
7 changes: 6 additions & 1 deletion assets/javascripts/lightbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit cd64560

Please sign in to comment.