Fix step attachments sorting (#1718)

This commit is contained in:
aignatov-bio 2019-05-06 09:56:26 +02:00 committed by GitHub
parent 60296419e8
commit cc8a152278
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View file

@ -665,7 +665,7 @@
$("#dd-att-step-" + stepId + "-label").html(label_value);
$('#att-' + stepId + ' a.file-preview-link').each(function(){
var elm = $(this)
elm.css('order', elm.attr('data-order-' + sortType));
elm.parent().css('order', elm.attr('data-order-' + sortType));
})
}

View file

@ -1,8 +1,7 @@
<div class="pseudo-attachment-container">
<div class="pseudo-attachment-container" style="order: <%= assets_count - i %>">
<%= link_to download_asset_path(asset),
class: 'file-preview-link',
id: "modal_link#{asset.id}",
style: "order: #{ assets_count - i }",
data: { no_turbolink: true, id: true, status: 'asset-present',
'preview-url': asset_file_preview_path(asset),
'order-atoz': az_ordered_assets_index(step, asset.id),