Enable image preview after editing protocol and disable preview modal animation [SCI-868]

This commit is contained in:
Oleksii Kriuchykhin 2017-01-09 17:19:46 +01:00
parent 57e1e1ec90
commit 4c9c9037ed
3 changed files with 9 additions and 7 deletions

View file

@ -205,6 +205,7 @@ function formEditAjax($form) {
initCallBacks();
initHandsOnTable($new_step);
toggleButtons(true);
initPreviewModal();
// Show the edited step
$new_step.find(".panel-collapse:first").addClass("collapse in");

View file

@ -17,17 +17,18 @@ function openPreviewModal(name, url, downloadUrl, description) {
type: 'GET',
dataType: 'json',
success: function(data) {
modal.find('.modal-body img').remove();
modal.find('.image-name').text(name);
var link = modal.find('.image-download-link');
link.attr('href', downloadUrl);
link.attr('data-no-turbolink', true);
link.attr('data-status', 'asset-present');
var image = modal.find('.modal-body img');
image.attr('src', data['large-preview-url']);
image.attr('alt', name);
image.click(function(ev) {
ev.stopPropagation();
});
modal.find('.modal-body').append($('<img>')
.attr('src', data['large-preview-url'])
.attr('alt', name)
.click(function(ev) {
ev.stopPropagation();
}));
modal.find('.modal-footer .image-description').text(description);
modal.find('.modal-body').click(function() {
modal.modal('hide');

View file

@ -1,4 +1,4 @@
<div id="imagePreviewModal" class="modal modal-image-preview fade" role="dialog" tabindex="-1" aria-labelledby="imagePreviewModal" aria-hidden="true">
<div id="imagePreviewModal" class="modal modal-image-preview" role="dialog" tabindex="-1" aria-labelledby="imagePreviewModal" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">