fixed some bugs and optimize codes

master
A1Gard 3 days ago
parent cf081b24fa
commit 73bc2d6b2e

@ -46,7 +46,7 @@ window.addEventListener('load', function () {
console.error('Error sending data:', error); console.error('Error sending data:', error);
}); });
} else { } else {
console.log('Data was sent recently. Skipping this time.'); // console.log('Data was sent recently. Skipping this time.');
} }

@ -17,7 +17,7 @@
{{ item[titleField] }} {{ item[titleField] }}
</template> </template>
<template v-else> <template v-else>
{{ item[titleField][xlang] }} {{ item[titleField]?.[xlang] ?? item[titleField] }}
</template> </template>
</li> </li>
@ -39,7 +39,7 @@
{{ item[titleField] }} {{ item[titleField] }}
</template> </template>
<template v-else> <template v-else>
{{ item[titleField][xlang] }} {{ item[titleField]?.[xlang] ?? item[titleField] }}
</template> </template>
<i class="ri-close-line" @click="rem(item[valueField])"></i> <i class="ri-close-line" @click="rem(item[valueField])"></i>
</span> </span>

@ -17,7 +17,7 @@
{{ item[titleField] }} {{ item[titleField] }}
</template> </template>
<template v-else> <template v-else>
{{ item[titleField][xlang] }} {{ item[titleField]?.[xlang] ?? item[titleField] }}
</template> </template>
</li> </li>
@ -39,7 +39,7 @@
{{ item[titleField] }} {{ item[titleField] }}
</template> </template>
<template v-else> <template v-else>
{{ item[titleField][xlang] }} {{ item[titleField]?.[xlang] ?? item[titleField] }}
</template> </template>
<i class="ri-close-line" @click="rem(item[valueField])"></i> <i class="ri-close-line" @click="rem(item[valueField])"></i>
</span> </span>

@ -16,7 +16,7 @@
{{ item[titleField] }} {{ item[titleField] }}
</template> </template>
<template v-else> <template v-else>
{{ item[titleField][xlang] }} {{ item[titleField]?.[xlang] ?? item[titleField] }}
</template> </template>
</li> </li>
</template> </template>
@ -39,7 +39,7 @@
{{ item[titleField] }} {{ item[titleField] }}
</template> </template>
<template v-else> <template v-else>
{{ item[titleField][xlang] }} {{ item[titleField]?.[xlang] ?? item[titleField] }}
</template> </template>
</option> </option>
</select> </select>

@ -29,7 +29,7 @@
<div class="p-2"> <div class="p-2">
@if($product->stock_status == 'IN_STOCK') @if($product->stock_status == 'IN_STOCK')
<a href="{{ route('client.product-card-toggle',$product->slug) }}" <a href="{{ route('client.product-card-toggle',$product->slug) }}"
class="btn btn-primary add-to-card"> class="btn btn-primary add-to-card w-100">
<i class="ri-shopping-bag-3-line"></i> <i class="ri-shopping-bag-3-line"></i>
{{__("Add to card")}} {{__("Add to card")}}
</a> </a>

@ -3,24 +3,28 @@ import {tns} from "tiny-slider/src/tiny-slider";
var sliderSimple ; var sliderSimple ;
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
document.querySelectorAll('.SliderSimple')?.forEach(function (el) { try {
if (el.classList.contains('.tns-slider')){ document.querySelectorAll('.SliderSimple')?.forEach(function (el) {
console.log('ignore'); if (el.classList.contains('.tns-slider')){
return 'ignore'; console.log('ignore');
} return 'ignore';
sliderSimple = tns({ }
container: el, sliderSimple = tns({
items: 1, container: el,
autoplay: true, items: 1,
autoplayButton: false, autoplay: true,
// nextButton: false, autoplayButton: false,
controls: false, // nextButton: false,
autoplayHoverPause: true, controls: false,
mouseDrag: true, autoplayHoverPause: true,
slideBy: 1, mouseDrag: true,
autoplayTimeout: 5000, slideBy: 1,
// speed:10000, autoplayTimeout: 5000,
}); // speed:10000,
}); });
});
} catch {
}
}); });

Loading…
Cancel
Save