diff --git a/public/javascripts/article.js b/public/javascripts/article.js index db1a9d4..aaaa111 100644 --- a/public/javascripts/article.js +++ b/public/javascripts/article.js @@ -28,16 +28,14 @@ jQuery(function($) { var button_zoom = $('.text-editor-sidebar meta[name=button.zoom]').attr('value'); var button_close = $('.text-editor-sidebar meta[name=button.close]').attr('value'); - function add_to_text_button() { - return '' + button_add + ''; + function add_to_text_button(extra_class) { + if (!extra_class) { extra_class = '' } + return '' + button_add + ''; } - function add_to_text_link() { - return '' + button_add + ''; - } - - function close_link() { - return '' + button_close + ''; + function close_button(extra_class) { + if (!extra_class) { extra_class = '' } + return '' + button_close + ''; } function zoom_button() { @@ -82,21 +80,21 @@ jQuery(function($) { } } - $('.controls a.add-to-text').live('click', function() { + $('a.add-to-text').live('click', function() { var $item = $(this).closest('.item'); var html_selector = $item.attr('data-item'); insert_item_in_text($item.find(html_selector)); $.colorbox.close(); return false; }); - $('.controls a.zoom').live('click', function() { + $('a.zoom').live('click', 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_link() + '   ' + close_link() + '
', maxWidth: '640px', maxHeight: '670px', scrolling: false }); + $.colorbox({ html: '
' + '
' + add_to_text_button('with-text') + '   ' + close_button('with-text') + '
', maxWidth: '640px', maxHeight: '640px', scrolling: false }); return false; }); - $('.controls a.close').live('click', function() { + $('a.close').live('click', function() { $.colorbox.close(); return false; }) -- libgit2 0.21.2