"use strict";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var _createClass=function(){function e(e,t){for(var a=0;a<t.length;a++){var i=t[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,a,i){return a&&e(t.prototype,a),i&&e(t,i),t}}();!function(e){var t=function(){function t(){_classCallCheck(this,t),this.action=0,this.$header=null}return _createClass(t,[{key:"initRealEstateNav",value:function(){}},{key:"setupValue",value:function(){this.$header||(this.$header=e("#masthead")),this.action=this.$header.outerHeight()+this.$header.offset().top}},{key:"initHeaderSticky",value:function(){if(e("body").hasClass("opal-header-sticky")){var t=wp.template("opal-header-sticky"),a=this.getTemplate("#masthead .mainmenu-skicky"),i="",s=e(a);s.length>0&&(s.find(".site-header-cart").remove(),s.find(".menu-item-search").remove(),s.find(".top-menu").css("marginRight",""),s.find(".top-menu > li").css("marginRight",""),i=s.get(0).outerHTML),e("body").append(t({logo:this.getTemplate("#masthead .site-branding"),menuFull:a,menu:i,account:this.getTemplate("#masthead .site-header-account"),cart:this.getTemplate("#masthead .site-header-cart"),wishlist:this.getTemplate("#masthead .site-header-wishlist"),search:this.getTemplate("#masthead .site-header-search"),itemCustom:this.getTemplate("#masthead .sticky-item-custom")})),this.addEventSticky()}}},{key:"addEventSticky",value:function(){var t=this;e(window).scroll(function(){var a=e("#opal-header-sticky");e(window).scrollTop()+10>t.action?a.hasClass("sticky-show")||a.addClass("sticky-show"):a.removeClass("sticky-show")})}},{key:"getTemplate",value:function(t){var a=e(t);return a.length>0?a.get(0).outerHTML:""}}]),t}();e(window).load(function(){new t})}(jQuery);
//# sourceMappingURL=sticky-header.js.map
