Commit 8d248734052d0c12b5881dfb3e60e19c52d181fc

Authored by Rodrigo Souto
1 parent 26cd97af

[media-panel-improvements] Add image title in zoom view

Showing 1 changed file with 4 additions and 3 deletions   Show diff stats
public/javascripts/article.js
@@ -74,9 +74,9 @@ jQuery(function($) { @@ -74,9 +74,9 @@ jQuery(function($) {
74 } 74 }
75 } 75 }
76 76
77 - function zoom_dialog_html(img) { 77 + function zoom_dialog_html(name, img) {
78 // FIXME organize this code better 78 // FIXME organize this code better
79 - return '<div class="item" data-item="div"><div><img src="' + img + '" style="max-width: 640px; max-height: 480px"/></div>' + '<div class="button-bar">' + add_to_text_button('with-text') + '&nbsp;&nbsp;&nbsp;' + close_button('with-text') + '</div></div>' 79 + return '<h3 style="text-align: center;">'+ name +'</h3><div class="item" data-item="div"><div><img src="' + img + '" style="max-width: 640px; max-height: 480px"/></div>' + '<div class="button-bar">' + add_to_text_button('with-text') + '&nbsp;&nbsp;&nbsp;' + close_button('with-text') + '</div></div>'
80 } 80 }
81 81
82 $('.view-all-images .item').live('click', function(){ 82 $('.view-all-images .item').live('click', function(){
@@ -94,9 +94,10 @@ jQuery(function($) { @@ -94,9 +94,10 @@ jQuery(function($) {
94 $('a.zoom').live('click', function() { 94 $('a.zoom').live('click', function() {
95 var $item = $(this).closest('.item'); 95 var $item = $(this).closest('.item');
96 var html_selector = $item.attr('data-item'); 96 var html_selector = $item.attr('data-item');
  97 + var name = $item.attr('title');
97 var img = $item.find(html_selector).find('img').attr('src'); 98 var img = $item.find(html_selector).find('img').attr('src');
98 $.colorbox({ 99 $.colorbox({
99 - html: zoom_dialog_html(img), 100 + html: zoom_dialog_html(name, img),
100 scrolling: false 101 scrolling: false
101 }); 102 });
102 return false; 103 return false;