// noinspection SpellCheckingInspection "use strict"; (function ($) { $(window).on('elementor/frontend/init', function () { let KngParallaxBackgroundHandler = elementorModules.frontend.handlers.Base.extend({ onInit: function onInit() { if (this.$element.hasClass('kng-parallax-bg-yes')) { this.applyKngParallaxBackground(); } }, getReadySettings: function getReadySettings() { let settings = { kng_parallax_bg_image: this.getElementSettings('kng_parallax_bg_image'), kng_parallax_bg_speed: this.getElementSettings('kng_parallax_bg_speed'), kng_parallax_bg_type: this.getElementSettings('kng_parallax_bg_type') }; return $.extend({}, settings); }, onElementChange: function onElementChange() { if (this.$element.hasClass('kng-parallax-bg-yes')) { if (!this.$element.hasClass('kng-parallax-bg-applied')) { this.applyKngParallaxBackground(); } } }, applyKngParallaxBackground: function applyKngParallaxBackground() { let options = this.getReadySettings(); let element_ID = this.$element.data('id'); this.$element.addClass('kng-parallax-bg-applied'); this.$element.before(''); this.$element.before(''); this.$element.append('
'); this.$element.after(''); } }); elementorFrontend.hooks.addAction('frontend/element_ready/global', function ($scope) { elementorFrontend.elementsHandler.addHandler(KngParallaxBackgroundHandler, { $element: $scope }); }); }); })(jQuery);