Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added option to image picker to allow a link to toggle the display of…

… the image.
  • Loading branch information...
commit 0087072411165d347cadd9f68a76406c04286fc5 1 parent 3c1b097
@parndt parndt authored
View
2  VERSION
@@ -1 +1 @@
-0.9.5.19
+0.9.5.20
View
3  vendor/plugins/pages/app/views/admin/pages/_form.html.erb
@@ -60,7 +60,8 @@
{
:f => f,
:field => :custom_title_image_id,
- :image => @page.custom_title_image
+ :image => @page.custom_title_image,
+ :toggle_image_display => false
}
%>
</div>
View
10 vendor/plugins/refinery/app/views/shared/admin/_image_picker.html.erb
@@ -1,5 +1,6 @@
+<%= link_to "Show", "", :id => "current_image_toggler" if (toggle_image_display ||= false) %>
<%= f.hidden_field field %>
-<div>
+<div id='current_image_container'<%= " style='display: none'" if (toggle_image_display ||= false) %>>
<a id='current_image_link' href="<%= insert_admin_images_url %>?thickbox=true&amp;modal=true&amp;titlebar=true&amp;field=<%= f.object.class.name.underscore.downcase %>_<%= field %>&amp;update_image=current_picked_image&amp;callback=picked_image_changed&amp;thumbnail=&amp;KeepThis=true&amp;TB_iframe=true&amp;width=<%= width ||= 950 %>&amp;height=<%= height ||= 510 %>" style='border: 0px' title='Change <%= (description ||= "image").titleize %>' name='Change <%= (description ||= "image").titleize %>' class='thickbox'>
<% unless image.nil? %>
<%= image_fu image, nil, {:class => "brown_border", :id => "current_picked_image"} %>
@@ -37,6 +38,13 @@
this.hide();
e.stop();
});
+<% if toggle_image_display ||= false -%>
+ jQuery('#current_image_toggler').click(function(e){
+ jQuery(this).html((jQuery(this).html() == 'Show' ? 'Hide' : 'Show'));
+ jQuery("#current_image_container").toggle();
+ e.preventDefault();
+ });
+<% end -%>
});
</script>
<% end %>
Please sign in to comment.
Something went wrong with that request. Please try again.