Sha256: 7e2495439892c08e9b4d9fe62e2b07802a5350c6fbe6ec7239058cc86fe88b07

Contents?: true

Size: 996 Bytes

Versions: 13

Compression:

Stored size: 996 Bytes

Contents

id = @file_attachment.id
attachable_name = @file_attachment.attachable.present? ? @file_attachment.attachable.name : 'orphanage'
if @file_attachment.valid?
  page << %Q{
    var original_container = $('#file_attachment_#{id}_file_container').text();
    $('#file_attachment_dynamic_form').hide();
    $('#file_attachment_#{id}_file_container').text("#{escape_javascript(@file_attachment.file_container)}");
    $('#file_attachment_#{id}_name a').text('#{escape_javascript(@file_attachment.name)}');
    $('#file_attachment_#{id}_description').text('#{escape_javascript(@file_attachment.description)}');
    $('#file_attachment_#{id}').effect('highlight', {
      color: '#C3D9FF'
    }, 2500);
    
    if( original_container !== $('#file_attachment_#{id}_file_container').text() ) {
      $('<p style="background:#C3D9FF;"><em>Moved to #{attachable_name}</em></p>').insertBefore($('#file_attachment_#{id}_name'));
    }
  }
else
  page << %Q{
    alert("The file could not be updated.");
  }
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
file_share-0.1.16 app/views/file_attachments/update.js.rjs
file_share-0.1.15 app/views/file_attachments/update.js.rjs
file_share-0.1.13 app/views/file_attachments/update.js.rjs
file_share-0.1.12 app/views/file_attachments/update.js.rjs
file_share-0.1.11 app/views/file_attachments/update.js.rjs
file_share-0.1.9 app/views/file_attachments/update.js.rjs
file_share-0.1.8 app/views/file_attachments/update.js.rjs
file_share-0.1.7 app/views/file_attachments/update.js.rjs
file_share-0.1.6 app/views/file_attachments/update.js.rjs
file_share-0.1.5 app/views/file_attachments/update.js.rjs
file_share-0.1.4 app/views/file_attachments/update.js.rjs
file_share-0.1.3 app/views/file_attachments/update.js.rjs
file_share-0.1.2 app/views/file_attachments/update.js.rjs