![]() 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/www/wp-content/themes/dt-the7/js/compatibility/elementor/ |
jQuery(function ($) { $.searchForm = function (el) { let $widget = $(el), $searchInput = $widget.find('.the7-search-form__input'), $searchClear = $widget.find('.the7-clear-search'); methods = {}; // Private methods methods = { init: function () { if($searchInput.val().length > 0 ){ $searchInput.parent().addClass('show-clear'); } $searchInput.focusout(function() { if($searchInput.val().length <= 0 ){ $searchInput.parent().removeClass('show-clear'); } }); $searchInput.on("keyup", function() { if($searchInput.val().length > 0 ){ $searchInput.parent().addClass('show-clear'); } else { $searchInput.parent().removeClass('show-clear'); } }); $searchClear.click(function(e){ $searchClear.parent().removeClass('show-clear'); $searchInput.val("").attr("value", ""); }) }, }; //global functions methods.init(); }; $.fn.searchForm = function () { return this.each(function () { if ($(this).data('searchForm') !== undefined) { $(this).removeData("searchForm") } new $.searchForm(this); }); }; }); (function ($) { // Make sure you run this code under Elementor. $(window).on("elementor/frontend/init", function () { elementorFrontend.hooks.addAction("frontend/element_ready/the7-search-form-widget.default", function ($widget, $) { $(document).ready(function () { $widget.searchForm(); }) }); }); })(jQuery);