Не прокатывает
function image() {
var img=$(this).closest('#edit-image').find('img').attr('src');
$('#file-image-show').attr("src", img);
alert(img);
};
пишет: undefined
вот полностью код:
<div class="thumbnail" id="edit-image" style=" height: 250px !important;">
{% set ADB_VIEW_BUTTON = '' %}
{% if file.mimeType.fileGroups.name == 'Image' %}
<img class="file-image" src="{{ file.link | apply_filter('account_avatar_img')}}" />
{% set ADB_VIEW_BUTTON = '<a href="#" class="btn view-image" style="position: absolute; bottom: 10px; left: 10px;"><img src="'~ asset ("omlook/img/eye.png") ~'" alt="{%trans%}ADB_VIEW{%endtrans%}" style="margin-top: -2px;" />' ~ '</a>' %}
{% else %}
<img src="{{ 'img_admin/icon-not-available.jpg' | apply_filter('account_avatar_img') }}" />
{% set ADB_VIEW_BUTTON = '<a href="'~ asset(file.link) ~'" class="btn " style="position: absolute; bottom: 10px; left: 10px;"><img src="'~ asset ("omlook/img/eye.png") ~'" alt="{%trans%}ADB_VIEW{%endtrans%}" style="margin-top: -2px;" />' ~ '</a>' %}
{% endif %}
<div class="caption">
<p>
<a href="#myModal1" role="button" data-toggle="modal" class="btn btn-danger" onclick="image()" style="position: absolute; bottom: 10px; right: 10px; padding: 4px 13px 4px 13px;">
<img src="{{ asset ('omlook/img/cancel.png') }}" alt="{%trans%}ADB_DELETE_IMG{%endtrans%}" style="margin-top: -2px;" />
</a>
{#<a href="#" class="btn btn-info view-image">{%trans%}ADB_VIEW{%endtrans%}</a>#}
{{ ADB_VIEW_BUTTON | raw }}
</p>
</div>
</div>
вот куда должна выводиться картинка:
<!-- Modal -->
<div id="myModal1" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">{%trans%}ADB_DELETE_IMG_VOPR{%endtrans%}</h3>
</div>
<div class="modal-body" style="text-align: center;">
<p>
<img class="file-image" id="file-image-show" src="" />
</p>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">{%trans%}ADB_DELETE_IMG_CLOSE{%endtrans%}</button>
{% set files = deal.files %}
{% for file in files %}
<button class="btn btn-danger"><a href="{{ path('_deal_delete_file', {'fileId': file.id, 'dealId': deal.id }) }}" style="color: #ffffff;">{%trans%}ADB_DELETE_IMG{%endtrans%}</a></button>
{% endfor %}
</div>
</div>