new: remove the "previsualisation" side pane from the "offre" admin edit form
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
@endif
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-8">
|
||||
<div class="col-12">
|
||||
<div class="row mb-3">
|
||||
<div class="col-12">
|
||||
@include('components.form.select', [
|
||||
@@ -105,13 +105,6 @@
|
||||
</div>
|
||||
@endcomponent
|
||||
</div>
|
||||
<div class="col-4">
|
||||
@component('components.card', ['title' => 'Previsualisation'])
|
||||
<div id="preview-article"></div>
|
||||
<div id="preview-variation"></div>
|
||||
<div id="preview-tariff"></div>
|
||||
@endcomponent
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -126,59 +119,8 @@
|
||||
{!! JsValidator::formRequest('App\Http\Requests\Admin\Shop\StoreOfferPost', '#offer-form') !!}
|
||||
|
||||
<script>
|
||||
function handleArticle() {
|
||||
$('.select_article').change(function() {
|
||||
previewArticle($(this).val());
|
||||
})
|
||||
}
|
||||
|
||||
function previewArticle(id) {
|
||||
var url = '{{ route('Admin.Shop.Offers.previewArticle') }}/' + id;
|
||||
$('#preview-article').load(url, function() {
|
||||
initChevron();
|
||||
});
|
||||
}
|
||||
|
||||
function handleVariation() {
|
||||
$('.select_variation').change(function() {
|
||||
previewVariation($(this).val());
|
||||
})
|
||||
}
|
||||
|
||||
function previewVariation(id) {
|
||||
var url = '{{ route('Admin.Shop.Offers.previewVariation') }}/' + id;
|
||||
$('#preview-variation').load(url, function() {
|
||||
initChevron();
|
||||
});
|
||||
}
|
||||
|
||||
function handleTariff() {
|
||||
$('.select_tariffs').change(function() {
|
||||
previewTariff($(this).val());
|
||||
})
|
||||
}
|
||||
|
||||
function previewTariff(id) {
|
||||
var url = '{{ route('Admin.Shop.Offers.previewTariff') }}/' + id;
|
||||
$('#preview-tariff').load(url, function() {
|
||||
initChevron();
|
||||
});
|
||||
}
|
||||
|
||||
function initPreview() {
|
||||
previewArticle("{{ $offer['article_id'] ?? null }}");
|
||||
previewVariation("{{ $offer['variation_id'] ?? null }}");
|
||||
previewTariff("{{ $offer['tariff_id'] ?? null }}");
|
||||
}
|
||||
|
||||
handleArticle();
|
||||
handleVariation();
|
||||
handleTariff();
|
||||
initChevron();
|
||||
initSaveForm('#offer-form');
|
||||
initSelect2();
|
||||
@if ($offer['id'] ?? false)
|
||||
initPreview();
|
||||
@endif
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
Reference in New Issue
Block a user