File "searchFullScreen.min.js"
Full Path: /home/ycoalition/public_html/blog/wp-content/themes/woodmart/js/scripts/global/searchFullScreen.min.js
File size: 2.5 KB
MIME-type: text/plain
Charset: utf-8
!function(s){woodmartThemeModule.searchFullScreen=function(){var d=s("[class*=wd-search-full-screen]"),o=("yes"===woodmart_settings.ajax_fullscreen_content&&woodmartThemeModule.$body.on("mouseover click touchstart",".wd-header-search.wd-display-full-screen > a, .wd-search-form.wd-display-full-screen-2",function(){var o,e=s(this);e.hasClass("wd-inited")||(e.addClass("wd-inited"),(o=d.find(".wd-search-area")).length&&s.ajax({url:woodmart_settings.ajaxurl,data:{action:"woodmart_load_full_search_html"},dataType:"json",method:"POST",success:function(e){e.content&&(o.html(e.content),setTimeout(function(){d.addClass("wp-content-loaded")},10),woodmartThemeModule.$document.trigger("wdSearchFullScreenContentLoaded"),woodmartThemeModule.$document.trigger("wood-images-loaded"))},error:function(){console.log("loading html full search ajax error")}}))}),woodmartThemeModule.$body.on("click",".wd-header-search.wd-display-full-screen > a, .wd-search-form.wd-display-full-screen-2",function(e){e.preventDefault();var e=s(this),o=s(".wd-search-full-screen-2");0<e.parent().find(".wd-search-dropdown").length||woodmartThemeModule.$body.hasClass("global-search-dropdown")||(r()?a():(e.hasClass("wd-display-full-screen-2")||(o=s(".wd-search-full-screen"),t()),setTimeout(function(){n(o)},10)))}),woodmartThemeModule.$body.on("click",".wd-close-search a, .website-wrapper, .header-banner",function(e){!s(e.target).is(".wd-close-search a")&&s(e.target).closest(".wd-search-full-screen").length||(s(e.target).is(".wd-close-search a")&&e.preventDefault(),r()&&a())}),function(e){27===e.keyCode&&(a(),woodmartThemeModule.$body.unbind("keyup",o))}),a=function(){s("html").removeClass("wd-search-opened"),d.removeClass("wd-opened"),setTimeout(function(){d.removeClass("wd-searched")},500)},t=function(){var e,o=s("#wpadminbar"),o=0<o.length?o.outerHeight():0,d=s(".whb-sticked"),a=s(".whb-main-header");0<d.length?e=0<s(".whb-clone").length?d.outerHeight()+o:a.outerHeight()+o:(e=a.outerHeight()+o,woodmartThemeModule.$body.hasClass("header-banner-display")&&(e+=s(".header-banner").outerHeight())),s(".wd-search-full-screen").css("top",e)},n=function(e){woodmartThemeModule.$body.on("keyup",o),s("html").addClass("wd-search-opened"),e.addClass("wd-opened"),setTimeout(function(){e.find('input[type="text"]').trigger("focus"),1024<woodmartThemeModule.windowWidth&&woodmartThemeModule.$window.one("scroll",function(){r()&&a()})},500)},r=function(){return s("html").hasClass("wd-search-opened")}},s(document).ready(function(){woodmartThemeModule.searchFullScreen()})}(jQuery);