mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-03 20:20:58 +00:00
Add "modal image" display for part thumbnails
This commit is contained in:
@ -909,3 +909,42 @@ function launchModalForm(url, options = {}) {
|
||||
// Send the AJAX request
|
||||
$.ajax(ajax_data);
|
||||
}
|
||||
|
||||
|
||||
function hideModalImage() {
|
||||
|
||||
var modal = $('#modal-image-dialog');
|
||||
|
||||
modal.animate({
|
||||
opacity: 0.0,
|
||||
}, 250, function() {
|
||||
modal.hide();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
function showModalImage(image_url) {
|
||||
// Display full-screen modal image
|
||||
|
||||
console.log('showing modal image: ' + image_url);
|
||||
|
||||
var modal = $('#modal-image-dialog');
|
||||
|
||||
// Set image content
|
||||
$('#modal-image').attr('src', image_url);
|
||||
|
||||
modal.show();
|
||||
|
||||
modal.animate({
|
||||
opacity: 1.0,
|
||||
}, 250);
|
||||
|
||||
$('#modal-image-close').click(function() {
|
||||
hideModalImage();
|
||||
});
|
||||
|
||||
modal.click(function() {
|
||||
hideModalImage();
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user