Add new version in repository
This commit is contained in:
@@ -16,32 +16,28 @@
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
@if ($can_edit ?? true)
|
||||
function {{ $prefix ?? '' }}handleDeleteImages() {
|
||||
$('#{{ $prefix ?? '' }}uploader-mini-gallery .fa-trash').click(function() {
|
||||
id = $('#id').val();
|
||||
index = $(this).data('index');
|
||||
console.log(id);
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: "{{ $delete_url ?? '' }}",
|
||||
data: {
|
||||
id: id,
|
||||
index: index
|
||||
},
|
||||
success: function(data) {
|
||||
loadImages();
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
@endif
|
||||
function {{ $prefix ?? '' }}handleDeleteImages() {
|
||||
$('#{{ $prefix ?? '' }}uploader-mini-gallery .fa-trash').click(function() {
|
||||
id = $('#id').val();
|
||||
index = $(this).data('index');
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: "{{ $delete_url ?? '' }}",
|
||||
data: {
|
||||
id: id,
|
||||
index: index
|
||||
},
|
||||
success: function(data) {
|
||||
{{ $prefix ?? '' }}loadImages();
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
function {{ $prefix ?? '' }}handleEnlargeImages() {
|
||||
$('#{{ $prefix ?? '' }}uploader-mini-gallery .fa-expand-alt').click(function() {
|
||||
$img = $(this).parents('figure').find('.img-thumbnail');
|
||||
$img = $(this).parents('figure').find('.img-thumbnail');
|
||||
url = $img.attr('src');
|
||||
console.log(url);
|
||||
$('#{{ $prefix ?? '' }}mini-gallery-lightbox .lightbox').attr('src', url);
|
||||
$('#{{ $prefix ?? '' }}mini-gallery-lightbox').modal('show');
|
||||
})
|
||||
|
||||
@@ -42,7 +42,10 @@
|
||||
{
|
||||
$gallery = $("#{{ $prefix ?? '' }}uploader-mini-gallery");
|
||||
if ($gallery) {
|
||||
$gallery.load("{{ $load_url }}");
|
||||
$gallery.load("{{ $load_url }}", function() {
|
||||
{{ $prefix ?? '' }}handleEnlargeImages();
|
||||
{{ $prefix ?? '' }}handleDeleteImages();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user