Add preview from father, add new features
This commit is contained in:
@@ -2,51 +2,57 @@
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Photos</h3>
|
||||
<h3 class="card-title">{{ $title }}</h3>
|
||||
<div class="card-tools">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body pt-3 pb-0">
|
||||
@if (isset($id))
|
||||
@if (isset($article['id']))
|
||||
@include('components.uploader.mini-gallery')
|
||||
@endif
|
||||
|
||||
<div id="uploader-new-images"></div>
|
||||
@include('components.uploader.block_image_new', ['name' => 'images[]', 'required' => true])
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button type="button" class="btn btn-xs btn-primary add-image pull-right">Ajout <i class="fa fa-plus"></i></button>
|
||||
@if ($can_edit ?? true)
|
||||
<div id="{{ $prefix ?? '' }}uploader-new-images"></div>
|
||||
@include('components.uploader.block_image_new', ['name' => 'images[]', 'required' => true])
|
||||
@endif
|
||||
</div>
|
||||
@if ($can_edit ?? true)
|
||||
<div class="card-footer">
|
||||
<button type="button" class="btn btn-xs btn-primary {{ $prefix ?? '' }}add-image pull-right">Ajout <i class="fa fa-plus"></i></button>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
function append_image() {
|
||||
$("#uploader-new-images .file").fileinput();
|
||||
$("#uploader-new-images .file").focus();
|
||||
function {{ $prefix ?? '' }}append_image() {
|
||||
$("#{{ $prefix ?? '' }}uploader-new-images .file").fileinput();
|
||||
$("#{{ $prefix ?? '' }}uploader-new-images .file").focus();
|
||||
}
|
||||
|
||||
$("#uploader-new-images").appender({
|
||||
rowSection: '.row-new-image',
|
||||
type: '.row-image',
|
||||
addBtn: '.add-image',
|
||||
$("#{{ $prefix ?? '' }}uploader-new-images").appender({
|
||||
rowSection: '.{{ $prefix ?? '' }}row-new-image',
|
||||
type: '.{{ $prefix ?? '' }}row-image',
|
||||
addBtn: '.{{ $prefix ?? '' }}add-image',
|
||||
appendEffect: 'fade',
|
||||
addClass: 'animated fadeIn',
|
||||
rowNumber: '.row-image-number',
|
||||
deleteBtn: '.delete-new-image-btn',
|
||||
callback: append_image,
|
||||
rowNumber: '.{{ $prefix ?? '' }}row-image-number',
|
||||
deleteBtn: '.{{ $prefix ?? '' }}delete-new-image-btn',
|
||||
callback: {{ $prefix ?? '' }}append_image,
|
||||
hideSection: true
|
||||
});
|
||||
|
||||
function loadImages()
|
||||
{
|
||||
$gallery = $("#uploader-mini-gallery");
|
||||
$gallery = $("#{{ $prefix ?? '' }}uploader-mini-gallery");
|
||||
if ($gallery) {
|
||||
$gallery.load("{{ $load_url }}");
|
||||
}
|
||||
}
|
||||
|
||||
loadImages();
|
||||
$(function() {
|
||||
loadImages();
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
Reference in New Issue
Block a user