");$(".master-slider").slick({slidesToShow:1,slidesToScroll:1,infinite:true,arrows:true,autoplay:true,prevArrow:('
'),nextArrow:('
')});const ratingStars=document.querySelectorAll(".form-ratings span");ratingStars.forEach((star,clickedIdx)=>{star.addEventListener("click",()=>{document.getElementById('star-review').value=clickedIdx+1;ratingStars.forEach((otherStart,ortherIdx)=>{otherStart.classList.remove("active");if(ortherIdx<=clickedIdx){otherStart.classList.add("active");}});});});$("#reviews_comment").on("submit",function(e){e.preventDefault();if($(this).valid()){$.post("/binh-luan-san-pham",$(this).serialize(),function(data){if(data.status){$.toast({heading:'Hệ thống đã ghi nhận đánh giá của bạn',text:data.msg,icon:'success'});$("#reviews_comment").trigger("reset");}else{$.toast({heading:'Gửi đánh giá không thành công',text:data.msg,icon:'error'});}});}});$(document).on("click","a.pagination__next[href]",function(){$.ajax({url:$(this).attr("href"),type:'GET',cache:false,success:function(result){$('#reviews-list').append(result);}});return false;});});