From 8d248734052d0c12b5881dfb3e60e19c52d181fc Mon Sep 17 00:00:00 2001 From: Rodrigo Souto Date: Tue, 29 Jul 2014 16:58:09 -0300 Subject: [PATCH] [media-panel-improvements] Add image title in zoom view --- public/javascripts/article.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/public/javascripts/article.js b/public/javascripts/article.js index 0e5eb2d..a5cc5e8 100644 --- a/public/javascripts/article.js +++ b/public/javascripts/article.js @@ -74,9 +74,9 @@ jQuery(function($) { } } - function zoom_dialog_html(img) { + function zoom_dialog_html(name, img) { // FIXME organize this code better - return '
' + '
' + add_to_text_button('with-text') + '   ' + close_button('with-text') + '
' + return '

'+ name +'

' + '
' + add_to_text_button('with-text') + '   ' + close_button('with-text') + '
' } $('.view-all-images .item').live('click', function(){ @@ -94,9 +94,10 @@ jQuery(function($) { $('a.zoom').live('click', function() { var $item = $(this).closest('.item'); var html_selector = $item.attr('data-item'); + var name = $item.attr('title'); var img = $item.find(html_selector).find('img').attr('src'); $.colorbox({ - html: zoom_dialog_html(img), + html: zoom_dialog_html(name, img), scrolling: false }); return false; -- libgit2 0.21.2