diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 3d9121b..17b78cc 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1259,25 +1259,27 @@ module ApplicationHelper task.information[:message] % values end + def add_zoom_to_article_images + add_zoom_to_images if environment.enabled?(:show_zoom_button_on_article_images) + end + def add_zoom_to_images - if environment.enabled?(:show_zoom_button_on_article_images) - stylesheet_link_tag('fancybox') + - javascript_include_tag('jquery.fancybox-1.3.4.pack') + - javascript_tag("jQuery(function($) { - $(window).load( function() { - $('#article .article-body img').each( function(index) { - var original = original_image_dimensions($(this).attr('src')); - if ($(this).width() < original['width'] || $(this).height() < original['height']) { - $(this).wrap('
'); - $(this).parent('.zoomable-image').attr('style', $(this).attr('style')); - $(this).attr('style', ''); - $(this).after(\'%s'); - } - }); - $('.zoomify-image').fancybox(); + stylesheet_link_tag('fancybox') + + javascript_include_tag('jquery.fancybox-1.3.4.pack') + + javascript_tag("jQuery(function($) { + $(window).load( function() { + $('#article .article-body img').each( function(index) { + var original = original_image_dimensions($(this).attr('src')); + if ($(this).width() < original['width'] || $(this).height() < original['height']) { + $(this).wrap(''); + $(this).parent('.zoomable-image').attr('style', $(this).attr('style')); + $(this).attr('style', ''); + $(this).after(\'%s'); + } }); - });" % _('Zoom in')) - end + $('.zoomify-image').fancybox(); + }); + });" % _('Zoom in')) end def render_dialog_error_messages(instance_name) diff --git a/app/views/catalog/index.rhtml b/app/views/catalog/index.rhtml index b317ab3..d6f4d81 100644 --- a/app/views/catalog/index.rhtml +++ b/app/views/catalog/index.rhtml @@ -13,14 +13,14 @@