I am trying to pass data from my master blade to the partial depending where it is open. This is part of my master blade:
<div id="main-section">
@section('topBar')
@include('customer.layouts.partials.top-bar')
@show
@section('header')
@include('customer.layouts.partials.header')
@show
@section('carousel')
@include('customer.layouts.partials.carousel', ['function' => 'drawer'])
@show
</div>
<div id="drawer">
<div id="item-detail">
</div>
<div id="item-detail-carousel">
@section('carousel')
@include('customer.layouts.partials.carousel', ['function' => 'itemDetail'])
@show
</div>
</div>
So, as you can see I am using customer.layouts.partials.carousel
in two places.
I am receiving data in my partial like this:
<div class="swiper-container {{ $function }}">
<div class="swiper-wrapper">
@foreach($issues as $issue)
<div class="swiper-slide">
<img
src="/imagecache/large/{{ $issue->first()->image }}"
onclick="{{ $function }}(
'{{ $issue->first()->magazine->id }}',
'{{ $issue->first()->magazine->name }}',
'{{ $issue->first()->magazine->summary ?: '' }}',
'{{ $issue->first()->magazine->image ?: '' }}',
'{{ $issue->first()->image }}'
)"
>
</div>
@endforeach
</div>
</div>
Div #drawer
is hidden first, has display:none
, and it is shown on click on an image in the slider in the main-section
. And then #drawer
gets slides over the main-section
. But when I inspect the elements in the chrome I see that both in the main-section
and in the drawer
section, data that was passed is drawer
. The #drawer
didn't get data ['function' => 'drawer']
as I thought it would.
How can I achieve that?