Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Uniformly size image thumbnails on fast insert.

  • Loading branch information...
commit dee6ced58d05aede5a94689d4bae342a76c139fb 1 parent 72c9e39
@robyurkowski robyurkowski authored
View
3  app/assets/javascripts/refinery/portfolio/admin/portfolio.js.coffee
@@ -4,8 +4,9 @@ $ = jQuery
window.portfolio =
append_image: (images) ->
$.each images, (index, image) ->
+ console.log image
image_id = $(image).attr('id').replace 'image_', ''
- image_src = $(image).attr('data-grid')
+ image_src = $(image).attr('data-medium')
new_image = $('li.image_field.blank:first').clone() # Clone li
new_image.find('.attributes input.image_id').val image_id # Set input image_id value = image_id
View
2  app/views/refinery/portfolio/admin/galleries/_image.html.erb
@@ -2,7 +2,7 @@
<% css_classes << 'blank' if image.new_record? %>
<li id='<%= "image_#{image.id || 'new'}" %>' class='<%= css_classes.join(' ') %>'>
- <div class='thumb'><% unless image.new_record? %><%= image_tag image.url %><% end %></div>
+ <div class='thumb'><% unless image.new_record? %><%= image_tag image.thumbnail(:medium).url %><% end %></div>
<div class='image_actions'>
<div class='floater'>
<%#= image_tag('refinery/icons/edit.png', {:width => 22, :height => 22, :class => 'edit_image', :alt => 'edit'}) %>
Please sign in to comment.
Something went wrong with that request. Please try again.