long item controlled for long tab items
This commit is contained in:
parent
94554a463e
commit
9a495ce457
19
resources/assets/js/views/common/contacts.js
vendored
19
resources/assets/js/views/common/contacts.js
vendored
@ -37,6 +37,25 @@ const app = new Vue({
|
||||
|
||||
mounted() {
|
||||
this.form.create_user = false;
|
||||
|
||||
//swiper slider for long tabs items
|
||||
for (let [index, item] of document.querySelectorAll('[data-swiper]').entries()) {
|
||||
item.id = index;
|
||||
|
||||
new Swiper(".swiper-tabs-container", {
|
||||
loop: false,
|
||||
slidesPerView: Number(item.getAttribute('data-swiper')),
|
||||
pagination: {
|
||||
el: ".swiper-pagination",
|
||||
clickable: true
|
||||
},
|
||||
navigation: {
|
||||
nextEl: ".swiper-button-next",
|
||||
prevEl: ".swiper-button-prev",
|
||||
},
|
||||
});
|
||||
}
|
||||
//swiper slider for long tabs items
|
||||
},
|
||||
|
||||
methods:{
|
||||
|
@ -134,7 +134,7 @@
|
||||
|
||||
@if (! $hideBottomRight)
|
||||
<x-show.content.right>
|
||||
<x-tabs active="documents">
|
||||
<x-tabs id="" slides="3" active="documents">
|
||||
<x-slot name="navs">
|
||||
@stack('documents_nav_start')
|
||||
|
||||
@ -146,6 +146,34 @@
|
||||
|
||||
@stack('transactions_nav_start')
|
||||
|
||||
<x-tabs.nav
|
||||
id="transactions"
|
||||
name="{{ trans_choice('general.transactions', 2) }}"
|
||||
/>
|
||||
<x-tabs.nav
|
||||
id="transactions"
|
||||
name="{{ trans_choice('general.transactions', 2) }}"
|
||||
/>
|
||||
<x-tabs.nav
|
||||
id="transactions"
|
||||
name="{{ trans_choice('general.transactions', 2) }}"
|
||||
/>
|
||||
<x-tabs.nav
|
||||
id="transactions"
|
||||
name="{{ trans_choice('general.transactions', 2) }}"
|
||||
/>
|
||||
<x-tabs.nav
|
||||
id="transactions"
|
||||
name="{{ trans_choice('general.transactions', 2) }}"
|
||||
/>
|
||||
<x-tabs.nav
|
||||
id="transactions"
|
||||
name="{{ trans_choice('general.transactions', 2) }}"
|
||||
/>
|
||||
<x-tabs.nav
|
||||
id="transactions"
|
||||
name="{{ trans_choice('general.transactions', 2) }}"
|
||||
/>
|
||||
<x-tabs.nav
|
||||
id="transactions"
|
||||
name="{{ trans_choice('general.transactions', 2) }}"
|
||||
|
@ -1,10 +1,28 @@
|
||||
@props(['active'])
|
||||
@props(['active', 'id'])
|
||||
|
||||
<div x-data="{ active: window.location.hash.split('#')[1] == undefined ? '{{ $active }}' : window.location.hash.split('#')[1] }">
|
||||
<div>
|
||||
<ul {{ ((! $attributes->has('override')) || ($attributes->has('override') && ! in_array('class', explode(',', $attributes->get('override'))))) ? $attributes->merge(['class' => 'flex items-center']) : $attributes }}>
|
||||
@php
|
||||
if (! empty($attributes['slides'])) {
|
||||
$slides = $attributes['slides'];
|
||||
}
|
||||
|
||||
if (empty($attributes['slides'])) {
|
||||
$slides = '2';
|
||||
}
|
||||
@endphp
|
||||
|
||||
<div id="{{ $id }}" data-swiper="{{ $slides }}" class="swiper" x-data="{ active: window.location.hash.split('#')[1] == undefined ? '{{ $active }}' : window.location.hash.split('#')[1] }">
|
||||
<div class="swiper-tabs-container">
|
||||
<ul class="swiper-wrapper" {{ ((! $attributes->has('override')) || ($attributes->has('override') && ! in_array('class', explode(',', $attributes->get('override'))))) ? $attributes->merge(['class' => 'flex items-center']) : $attributes }}>
|
||||
{!! $navs !!}
|
||||
</ul>
|
||||
|
||||
<div class="swiper-button-next top-3 right-0">
|
||||
<span class="material-icons">chevron_right</span>
|
||||
</div>
|
||||
|
||||
<div class="swiper-button-prev top-3 left-0">
|
||||
<span class="material-icons">chevron_left</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{!! $content !!}
|
||||
|
@ -1,7 +1,7 @@
|
||||
@props(['id', 'name', 'href', 'active'])
|
||||
|
||||
<li
|
||||
class="relative px-8 text-sm text-center pb-2 cursor-pointer transition-all border-b tabs-link"
|
||||
class="swiper-slide relative px-8 text-sm text-center pb-2 cursor-pointer transition-all border-b tabs-link"
|
||||
id="tab-{{ $id }}"
|
||||
data-id="tab-{{ $id }}"
|
||||
data-tabs="{{ $id }}"
|
||||
|
@ -1,7 +1,7 @@
|
||||
@props(['id', 'name', 'active'])
|
||||
|
||||
<li
|
||||
class="relative px-8 text-sm text-center pb-2 cursor-pointer transition-all border-b tabs-link"
|
||||
class="swiper-slide relative px-8 text-sm text-center pb-2 cursor-pointer transition-all border-b tabs-link"
|
||||
id="tab-{{ $id }}"
|
||||
data-id="tab-{{ $id }}"
|
||||
data-tabs="{{ $id }}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user