Commit 97c040985886a7692e44f7be24fceac152c8c0d7
Committed by
Daniela Feitosa
1 parent
a125dc04
Exists in
master
and in
29 other branches
Showing zoom link only on mouse over and some minor changes
(ActionItem1801)
Showing
2 changed files
with
21 additions
and
10 deletions
Show diff stats
app/helpers/application_helper.rb
... | ... | @@ -1195,16 +1195,18 @@ module ApplicationHelper |
1195 | 1195 | stylesheet_link_tag('fancybox') + |
1196 | 1196 | javascript_include_tag('jquery.fancybox-1.3.4.pack') + |
1197 | 1197 | javascript_tag("jQuery(function($) { |
1198 | - $('#article .article-body img').each( function(index) { | |
1199 | - var original = original_image_dimensions($(this).attr('src')); | |
1200 | - if ($(this).width() < original['width'] || $(this).height() < original['height']) { | |
1201 | - $(this).wrap('<div class=\"zoomable-image\" />'); | |
1202 | - $(this).parent('.zoomable-image').attr('style', $(this).attr('style')); | |
1203 | - $(this).attr('style', ''); | |
1204 | - $(this).after(\'<a href=\"' + $(this).attr('src') + '\" class=\"zoomify-image\"><span class=\"zoomify-text\">%s</span></a>'); | |
1205 | - } | |
1198 | + $(window).load( function() { | |
1199 | + $('#article .article-body img').each( function(index) { | |
1200 | + var original = original_image_dimensions($(this).attr('src')); | |
1201 | + if ($(this).width() < original['width'] || $(this).height() < original['height']) { | |
1202 | + $(this).wrap('<div class=\"zoomable-image\" />'); | |
1203 | + $(this).parent('.zoomable-image').attr('style', $(this).attr('style')); | |
1204 | + $(this).attr('style', ''); | |
1205 | + $(this).after(\'<a href=\"' + $(this).attr('src') + '\" class=\"zoomify-image\"><span class=\"zoomify-text\">%s</span></a>'); | |
1206 | + } | |
1207 | + }); | |
1208 | + $('.zoomify-image').fancybox(); | |
1206 | 1209 | }); |
1207 | - $('.zoomify-image').fancybox(); | |
1208 | 1210 | });" % _('Zoom in')) |
1209 | 1211 | end |
1210 | 1212 | end | ... | ... |
public/stylesheets/application.css
... | ... | @@ -1015,6 +1015,11 @@ code input { |
1015 | 1015 | display: inline-block; |
1016 | 1016 | } |
1017 | 1017 | |
1018 | +/* IE 8 hack to avoid max-width image bug */ | |
1019 | +.msie8 #content #article .article-body .zoomable-image img { | |
1020 | + max-width: none !important; | |
1021 | +} | |
1022 | + | |
1018 | 1023 | /* IE 7 hack to simulate inline-block */ |
1019 | 1024 | .msie7 .zoomable-image { |
1020 | 1025 | zoom: 1; |
... | ... | @@ -1025,7 +1030,7 @@ code input { |
1025 | 1030 | position: absolute; |
1026 | 1031 | left: 0; |
1027 | 1032 | top: 0; |
1028 | - display: block; | |
1033 | + display: none; | |
1029 | 1034 | width: 100%; |
1030 | 1035 | height: 16px; |
1031 | 1036 | text-align: left; |
... | ... | @@ -1033,6 +1038,10 @@ code input { |
1033 | 1038 | border-bottom: 1px solid #333; |
1034 | 1039 | } |
1035 | 1040 | |
1041 | +.zoomable-image:hover .zoomify-image { | |
1042 | + display: block; | |
1043 | +} | |
1044 | + | |
1036 | 1045 | #article .zoomify-image { |
1037 | 1046 | text-decoration: none; |
1038 | 1047 | color: #fff; | ... | ... |