Current File : /home/kelaby89/muzza.fit/wp-content/plugins/wolf-visual-composer/assets/js/min/modal-window.min.js |
/*! WPBakery Page Builder Extension Wordpress Plugin v3.7.17 */
var WVCModalWindow=function(a){"use strict";return{isMobile:!1,modalContentSelector:"#wvc-modal-window-container",$overlay:a("#wvc-modal-window-overlay"),closed:!0,open:!1,animated:!1,hasShownWhenNavigateAway:!1,cookieName:"wvc_mc_p",init:function(){this.isMobile=WVCParams.isMobile;var b=this;this.cookieName=WVCParams.themeSlug+"_wvc_mc_p",this.popUp(),this.closeButton(),a(window).on("wvc_fullpage_changed",function(){WVC.resetAOS(b.modalContentSelector)}),WVC.resetAOS(b.modalContentSelector),a("#wvc-modal-window").find(".wvc-modal-window-opt-out").length&&a("#wvc-modal-window-bottom-close").remove(),a(window).resize(function(){a("#wvc-modal-window-overlay").hasClass("wvc-modal-window-non_intrusive")&&a("#wvc-modal-window-overlay").css({height:a("#wvc-modal-window-content").height()})})},popUp:function(){var b=this;a(document).on("click",".wvc-modal-window-open",function(c){c.preventDefault(),a(".wvc-modal-window-opt-out").hide(),b.showPopup(1)}),"opt-out"!==Cookies.get(b.cookieName)&&("1"===WVCParams.modalWindowShowOnce&&"prevent"===Cookies.get(b.cookieName)||("1"!==WVCParams.modalWindowShowOnce&&Cookies.remove(b.cookieName,{path:""}),"1"===WVCParams.modalWindowNavigateAway?a(document).mouseleave(function(){b.showPopup()}):b.showPopup()))},showPopup:function(b){var c=this;!1!==c.closed&&!0!==c.hasShownWhenNavigateAway&&(b=b||WVCParams.modalWindowDelay,c.animated||(WVC.delayWow(this.modalContentSelector),WVC.resetAOS(this.modalContentSelector)),setTimeout(function(){c.$overlay.length&&(c.$overlay.addClass("wvc-modal-window-overlay-visible"),c.$overlay.one(WVC.transitionEventEnd(),function(){c.$overlay.addClass("wvc-show-modal-window"),a(c.modalContentSelector).one(WVC.transitionEventEnd(),function(){c.animated||(WVC.doWow(),WVC.doAOS(c.modalContentSelector),c.animated=!0,c.closed=!1,window.dispatchEvent(new Event("resize")),window.dispatchEvent(new Event("scroll")))})}))},b))},closeButton:function(){var b=this,c=parseInt(WVCParams.modalWindowCookieTime,10);a(document).on("click",".wvc-modal-window-close",function(d){d.preventDefault(),a(this).hasClass("wvc-modal-window-opt-out")&&Cookies.set(b.cookieName,"opt-out",{expires:c,path:"/"}),"1"===WVCParams.modalWindowShowOnce&&Cookies.set(b.cookieName,"prevent",{expires:c,path:"/"}),"1"===WVCParams.modalWindowNavigateAway&&(b.hasShownWhenNavigateAway=!0),b.closeWindow()}),b.isMobile||a(document).mouseup(function(c){if(1===c.which&&!a("#wvc-modal-window-overlay").hasClass("wvc-modal-window-non_intrusive")){var d=a("#wvc-modal-window-container, #wvc-privacy-policy-message-container");d.is(c.target)||0!==d.has(c.target).length||b.closeWindow()}})},closeWindow:function(){var b=this;b.$overlay.removeClass("wvc-modal-window-overlay-visible"),b.$overlay.one(WVC.transitionEventEnd(),function(){a(this).removeClass("wvc-show-modal-window"),setTimeout(function(){WVC.delayWow(b.modalContentSelector),WVC.resetAOS(b.modalContentSelector),b.closed=!0,b.animated=!1},200)})}}}(jQuery);!function(a){"use strict";a(window).on("page_loaded",function(){WVCModalWindow.init()})}(jQuery);