<style>
/* Estilo del texto con límite de 3 líneas */
.text-container {
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
transition: max-height 0.5s ease;
}
/* Cuando está expandido, se muestra completo */
.expanded {
-webkit-line-clamp: unset;
}
/* Estilo del botón */
.toggle-btn {
cursor: pointer;
color: #007bff;
font-weight: bold;
text-align: center;
margin-top: 8px;
user-select: none;
display: inline-block;
}
/* Aumentar el ancho del tooltip */
.tooltip-inner {
max-width: 300px !important; /* Puedes cambiar este valor */
text-align: left;
white-space: normal;
}
.order-container .title-block{
top: 30px;
z-index: 1000;
background: #f8f9fa;
}
</style>
{% for product in products %}
{% include "components/products/product.html.twig" with {'product': product} %}
{% endfor %}
<script>
$(document).ready(function() {
// Inicializar tooltips de Bootstrap
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'));
var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
return new bootstrap.Tooltip(tooltipTriggerEl);
});
$(".toggle-btn").each(function() {
var fullText = $(this).prev(".text-container").text(); // Obtener el texto completo
$(this).attr("title", fullText); // Asignar el texto al tooltip
});
});
</script>