mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-06 06:56:54 +08:00
Merge pull request #397 from okriuchykhin/ok_SCI_868
Enable image preview after editing protocol and disable preview modal animation [SCI-868]
This commit is contained in:
commit
f3b462bccb
3 changed files with 9 additions and 7 deletions
|
@ -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");
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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">
|
||||
|
|
Loading…
Reference in a new issue