Sha256: 532bbc8f94ceb33ce55d0f656c1ee9e5e2b0793ba4e2c30e24391c39aff21149
Contents?: true
Size: 937 Bytes
Versions: 19
Compression:
Stored size: 937 Bytes
Contents
var hidden_input = $("input[name='<%= j params[:page_part_id] %>[photo_tokens]']"); <% if @photos.present? %> var photo_collection = $("<%= j render partial: 'photo_collection', locals: {photos: @photos} %>"); hidden_input.parents('td').find('.photo-collection').html(photo_collection); hidden_input.parents('td').find('a .placeholder').addClass('pull-right'); hidden_input.val("<%= @photos.map(&:id).join(',') %>"); <% else %> hidden_input.parents('td').find('a .placeholder').removeClass('pull-right'); hidden_input.val(""); <% end %> $('.sortable-grid').sortable('destroy'); $('.sortable-grid').sortable().bind('sortupdate', function(e) { position_array = []; $(e.target).find('li.image').each(function(index) { position_array.push($(this).data('photo-id')); }); $(e.target).parents('td').find('.photo-positions').val(position_array.join(",")); }); $('.sortable-grid').trigger('sortupdate'); $.hideModal();
Version data entries
19 entries across 19 versions & 1 rubygems