diff --git a/public/javascripts/article.js b/public/javascripts/article.js index 6095a5f..f6ff887 100644 --- a/public/javascripts/article.js +++ b/public/javascripts/article.js @@ -80,6 +80,11 @@ jQuery(function($) { } } + function zoom_dialog_html(img) { + // FIXME organize this code better + return '
' + '
' + add_to_text_button('with-text') + '   ' + close_button('with-text') + '
' + } + $('a.add-to-text').live('click', function() { var $item = $(this).closest('.item'); var html_selector = $item.attr('data-item'); @@ -91,7 +96,10 @@ jQuery(function($) { var $item = $(this).closest('.item'); var html_selector = $item.attr('data-item'); var img = $item.find(html_selector).find('img').attr('src'); - $.colorbox({ html: '
' + '
' + add_to_text_button('with-text') + '   ' + close_button('with-text') + '
', scrolling: false }); + $.colorbox({ + html: zoom_dialog_html(img), + scrolling: false + }); return false; }); $('a.close').live('click', function() { -- libgit2 0.21.2