PluginProbe
King Addons for Elementor – 80+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce, Mega Menu, Popup Builder / 51.1.65
King Addons for Elementor – 80+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce, Mega Menu, Popup Builder v51.1.65
51.1.83 51.1.82 51.1.81 51.1.79 51.1.78 51.1.77 51.1.76 51.1.74 51.1.75 51.1.65 51.1.64 51.1.63 trunk 51.1.14 51.1.2 51.1.35 51.1.36 51.1.37 51.1.38 51.1.39 51.1.44 51.1.45 51.1.46 51.1.47 51.1.49 All 37 releases
king-addons / includes / widgets / Feature_List / script.js

script.js in King Addons for Elementor – 80+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce, Mega Menu, Popup Builder 51.1.65, at includes/widgets/Feature_List/script.js

34 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 "use strict";
2 (function ($) {
3 $(window).on('elementor/frontend/init', function () {
4 // Define the custom handler for the Feature List line adjustments
5 let FeatureListLineHandler = elementorModules.frontend.handlers.Base.extend({
6 onInit: function onInit() {
7 this.adjustFeatureListLines();
8 $(window).resize(this.adjustFeatureListLines.bind(this));
9 },
10
11 adjustFeatureListLines: function adjustFeatureListLines() {
12 let $scope = this.$element;
13
14 $scope.find('.king-addons-feature-list-item:not(:last-of-type)').find('.king-addons-feature-list-icon-wrap').each(function (index) {
15 let nextOffsetTop = $scope.find('.king-addons-feature-list-item').eq(index + 1).find('.king-addons-feature-list-icon-wrap').offset().top;
16 let currentOffsetTop = $(this).offset().top;
17
18 // Calculate the line height
19 let lineHeight = nextOffsetTop - currentOffsetTop;
20
21 // Apply the calculated height to the line
22 $(this).find('.king-addons-feature-list-line').css('height', lineHeight + 'px');
23 });
24 }
25 });
26
27 // Initialize the handler when the specific widget is ready in Elementor
28 elementorFrontend.hooks.addAction('frontend/element_ready/king-addons-feature-list.default', function ($scope) {
29 elementorFrontend.elementsHandler.addHandler(FeatureListLineHandler, {
30 $element: $scope
31 });
32 });
33 });
34 })(jQuery);