Commit 243be325fe6b9943cd3827b96b4d9ae92080e246
1 parent
7261d10e
Exists in
master
and in
29 other branches
Add icons to controls in image zoom dialog
Showing
1 changed file
with
10 additions
and
12 deletions
Show diff stats
public/javascripts/article.js
... | ... | @@ -28,16 +28,14 @@ jQuery(function($) { |
28 | 28 | var button_zoom = $('.text-editor-sidebar meta[name=button.zoom]').attr('value'); |
29 | 29 | var button_close = $('.text-editor-sidebar meta[name=button.close]').attr('value'); |
30 | 30 | |
31 | - function add_to_text_button() { | |
32 | - return '<a class="button icon-add add-to-text" href="#"><span>' + button_add + '</span></a>'; | |
31 | + function add_to_text_button(extra_class) { | |
32 | + if (!extra_class) { extra_class = '' } | |
33 | + return '<a class="button icon-add add-to-text ' + extra_class + '" href="#"><span>' + button_add + '</span></a>'; | |
33 | 34 | } |
34 | 35 | |
35 | - function add_to_text_link() { | |
36 | - return '<a class="add-to-text" href="#">' + button_add + '</a>'; | |
37 | - } | |
38 | - | |
39 | - function close_link() { | |
40 | - return '<a class="close" href="#">' + button_close + '</a>'; | |
36 | + function close_button(extra_class) { | |
37 | + if (!extra_class) { extra_class = '' } | |
38 | + return '<a class="button icon-cancel close ' + extra_class + '" href="#"><span>' + button_close + '</span></a>'; | |
41 | 39 | } |
42 | 40 | |
43 | 41 | function zoom_button() { |
... | ... | @@ -82,21 +80,21 @@ jQuery(function($) { |
82 | 80 | } |
83 | 81 | } |
84 | 82 | |
85 | - $('.controls a.add-to-text').live('click', function() { | |
83 | + $('a.add-to-text').live('click', function() { | |
86 | 84 | var $item = $(this).closest('.item'); |
87 | 85 | var html_selector = $item.attr('data-item'); |
88 | 86 | insert_item_in_text($item.find(html_selector)); |
89 | 87 | $.colorbox.close(); |
90 | 88 | return false; |
91 | 89 | }); |
92 | - $('.controls a.zoom').live('click', function() { | |
90 | + $('a.zoom').live('click', function() { | |
93 | 91 | var $item = $(this).closest('.item'); |
94 | 92 | var html_selector = $item.attr('data-item'); |
95 | 93 | var img = $item.find(html_selector).find('img').attr('src'); |
96 | - $.colorbox({ html: '<div class="item" data-item="div"><div><img src="' + img + '" style="max-width: 580px; max-height: 580px"/></div>' + '<div class="controls" style="padding-top: 5px;">' + add_to_text_link() + ' ' + close_link() + '</div></div>', maxWidth: '640px', maxHeight: '670px', scrolling: false }); | |
94 | + $.colorbox({ html: '<div class="item" data-item="div"><div><img src="' + img + '" style="max-width: 580px; max-height: 580px"/></div>' + '<div class="button-bar" style="padding-top: 5px;">' + add_to_text_button('with-text') + ' ' + close_button('with-text') + '</div></div>', maxWidth: '640px', maxHeight: '640px', scrolling: false }); | |
97 | 95 | return false; |
98 | 96 | }); |
99 | - $('.controls a.close').live('click', function() { | |
97 | + $('a.close').live('click', function() { | |
100 | 98 | $.colorbox.close(); |
101 | 99 | return false; |
102 | 100 | }) | ... | ... |