/** * Main JavaScript file for the BlogMagazine theme. * * @package dineshghimire * @subpackage blogmagazine * @author Dinesh Ghimire * @license https://www.gnu.org/licenses/gpl-3.0.txt * @link https://dinesh-ghimire.com.np * @since 1.0.0 */ !function(s){"use strict";var n=s(window),o=s(document),r={Snipits:{AppendHTML:function(){s("#site-navigation .menu-item-has-children").append(' ')},Sliders:function(){var e={item:1,loop:!0,auto:!0,speed:2e3,pause:6e3,pager:!1,controls:!0,vertical:!0,enableDrag:!1,enableTouch:!1,verticalHeight:35,adaptiveHeight:!0,prevHtml:'',nextHtml:''};s(".blogmagazine-newsticker").each(function(){s(this).lightSlider(e)});var a={item:1,auto:!0,loop:!0,speed:2e3,pause:6e3,pager:!1,slideMargin:0,enableDrag:!1,enableTouch:!1,adaptiveHeight:!0,prevHtml:'',nextHtml:''};s(".blogmagazine-featured-main-slider").each(function(){s(this).lightSlider(a)}),s(".blogmagazine-block-carousel").each(function(){var e={auto:!0,loop:!0,speed:2e3,pause:6e3,pager:!1,controls:!1,pauseOnHover:!0,adaptiveHeight:!0,prevHtml:'',nextHtml:'',item:4,responsive:[{breakpoint:840,settings:{item:2,slideMove:1,slideMargin:6}},{breakpoint:480,settings:{item:1,slideMove:1}}]};s(this).closest(".sidebar-right, .sidebar-left").length&&(e.item=1);var a=s(this).lightSlider(e);a.closest(".widget").find(".blogmagazine-carousel-control").on("click",function(e){s(this).hasClass("blogmagazine-nav-prev")?a.goToPrevSlide():a.goToNextSlide()})})},Widget_Title_Tab:function(e){e.preventDefault();var a=s(this);if(!a.closest(".wdgt-tab-term").hasClass("active-item")){var l=a.closest(".wdgt-title-tabs");if(1!=l.attr("data-loading")){var i=a.data("tab"),n=(a.closest(".blogmagazine-block-title"),a.closest(".widget"));if(l.find(".wdgt-tab-term").removeClass("active-item"),a.closest("li").addClass("active-item"),n.find(".blogmagazine-block-posts-wrapper").removeClass("tab-active"),n.find("."+i).length)n.find("."+i).addClass("tab-active");else{var t=s(this).data("ajax-args");t.beforeSend=function(){l.attr("data-loading",1),n.find(".blgmg-wdgt-preloader").removeClass("hidden")},t.success=function(e,a,i){l.attr("data-loading",0),n.find(".blgmg-wdgt-preloader").addClass("hidden");var t=e.widget_html;t?n.find(".blgmg-tab-alldata").after(t):console.warn("Sorry faild to retrive widget html data on ajax call")},t.fail=function(e,a,i){l.attr("data-loading",0),console.warn("Sorry faild widget tab ajax call")},s.ajax(t)}}}},StickyMenu:function(){if("function"==typeof s().sticky){var e=jQuery("#wpadminbar");e.length?jQuery("#blogmagazine-menu-wrap").sticky({topSpacing:e.height()}):jQuery("#blogmagazine-menu-wrap").sticky({topSpacing:0})}},DisplayScrollTop:function(){1e3