Sha256: 6ee89edc26a9dc49d5d926a5e8d3857732ebec9b223fc5af4976961f0ebc8e2d

Contents?: true

Size: 854 Bytes

Versions: 1

Compression:

Stored size: 854 Bytes

Contents

var hidden_input = $("input[name='<%= j params[:page_part_id] %>[page_partable_id]']");
hidden_input.parents('td').find('a .image, a .placeholder').remove();
<% if @photo.present? %>
  hidden_input.parents('td').find('a').prepend("<div class='placeholder pull-right'><span class='button button-small button-round' data-icon='U'><%= I18n.t('spina.pages.photo_picker') %></span></div><div class='image'><img src='<%= @photo.file.thumb %>' /></div>");
  hidden_input.val("<%= @photo.id %>");
<% else %>
  hidden_input.parents('td').find('a').prepend("<div class='placeholder'><span class='button button-small button-round' data-icon='U'><%= I18n.t('spina.pages.photo_picker') %></span></div>");
  hidden_input.parents('td').append("<input type='hidden' type='checkbox' name='<%= j params[:page_part_id] %>[_destroy]' value='1' />")
<% end %>
$.hideModal();

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
spina-0.6.13 app/views/spina/admin/photos/insert_photo.js.erb