| 1 |
"use strict"; |
| 2 |
|
| 3 |
(function ($) { |
| 4 |
const shouldShow = ($el) => { |
| 5 |
const device = $el.data("device") || "all"; |
| 6 |
if (device === "all") return true; |
| 7 |
const isMobile = window.matchMedia("(max-width: 767px)").matches; |
| 8 |
if (device === "mobile") return isMobile; |
| 9 |
if (device === "desktop") return !isMobile; |
| 10 |
return true; |
| 11 |
}; |
| 12 |
|
| 13 |
const initReviewSchema = ($scope) => { |
| 14 |
const $wrap = $scope.find(".king-addons-review"); |
| 15 |
if (!$wrap.length) return; |
| 16 |
|
| 17 |
if (!shouldShow($wrap)) { |
| 18 |
$wrap.hide(); |
| 19 |
} |
| 20 |
}; |
| 21 |
|
| 22 |
$(window).on("elementor/frontend/init", function () { |
| 23 |
elementorFrontend.hooks.addAction( |
| 24 |
"frontend/element_ready/king-addons-review-schema.default", |
| 25 |
function ($scope) { |
| 26 |
initReviewSchema($scope); |
| 27 |
} |
| 28 |
); |
| 29 |
}); |
| 30 |
})(jQuery); |
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|