![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/app/design/frontend/Cnc/default/Magento_Review/web/js/ |
/** * @override in order to handle reviews block outside of native tabs */ define([ 'jquery' ], function ($) { 'use strict'; /** * @param {String} url * @param {*} fromPages */ function processReviews(url, fromPages) { $.ajax({ url: url, cache: true, dataType: 'html', showLoader: false, loaderContext: $('.product.data.items') }).done(function (data) { $('#product-review-container').html(data).trigger('contentUpdated'); $('[data-role="product-review"] .pages a').each(function (index, element) { $(element).click(function (event) { //eslint-disable-line max-nested-callbacks processReviews($(element).attr('href'), true); event.preventDefault(); }); }); }).complete(function () { if (fromPages == true) { //eslint-disable-line eqeqeq $('html, body').animate({ scrollTop: $('#customer-reviews').offset().top - 80 }, 500); } }); } return function (config) { processReviews(config.productReviewUrl, location.hash === '#customer-reviews'); $(function () { $('.product-top-info-main .reviews-actions a').click(function (event) { var addReviewBlock; event.preventDefault(); addReviewBlock = $('#customer-reviews'); if (addReviewBlock.length) { $('html, body').animate({ scrollTop: addReviewBlock.offset().top - 80 }, 500); } }); }); }; });