( function( $ ) { var hotspotInterval = []; var hoverFlag = false; var isElEditMode = false; window.is_fb_loggedin = false; window.is_google_loggedin = false; var id = window.location.hash.substring( 1 ); var pattern = new RegExp( "^[\\w\\-]+$" ); var sanitize_input = pattern.test( id ); /** * Function to fetch widget settings. */ var getWidgetSettings = function ($element) { var widgetSettings = {}, modelCID = $element.data( 'model-cid' ); if ( isElEditMode && modelCID ) { var settings = elementorFrontend.config.elements.data[ modelCID ], settingsKeys = elementorFrontend.config.elements.keys[ settings.attributes.widgetType || settings.attributes.elType ]; jQuery.each( settings.getActiveControls(), function( controlKey ) { if ( -1 !== settingsKeys.indexOf( controlKey ) ) { widgetSettings[ controlKey ] = settings.attributes[ controlKey ]; } } ); } else { widgetSettings = $element.data( 'settings' ) || {}; } return widgetSettings; }; /** * Function for Before After Slider animation. * */ var UAELBASlider = function( $element ) { $element.css( 'width', '100%' ); var closest_section = $element.closest('.elementor-section'); if ( 0 != closest_section.length ) { $element.css( 'height', ' ' ); } var closest_container = $element.closest('.e-con'); if ( 0 != closest_container.length ) { $element.css( 'height', '100%' ); } max = -1; $element.find( "img" ).each(function() { if( max < $(this).width() ) { max = $(this).width(); } }); $element.css( 'width', max + 'px' ); } /** * Function for GF Styler select field. * */ var WidgetUAELGFStylerHandler = function( $scope, $ ) { if ( 'undefined' == typeof $scope ) return; var confirmation_div = $scope.find( '.gform_confirmation_message' ); var form_title = $scope.find( '.uael-gf-form-title' ); var form_desc = $scope.find( '.uael-gf-form-desc' ); $scope.find('select:not([multiple])').each(function() { var gfSelectField = $( this ); if( gfSelectField.next().hasClass('chosen-container') ) { gfSelectField.next().wrap( "" ); } else { gfSelectField.wrap( "" ); } }); if( $scope.hasClass( 'uael-gf-ajax-yes' ) ){ //AJAX form submission jQuery( document ).on( 'gform_confirmation_loaded', function( event, formId ){ // code to be trigger when confirmation page is loaded form_title.hide(); form_desc.hide(); }); } else { //Hide the forms title and description after submit. if( confirmation_div.length > 0 ){ form_title.hide(); form_desc.hide(); } else { form_title.show(); form_desc.show(); } } if( typeof gform !== 'undefined' ){ gform.addAction( 'gform_input_change', function( elem ) { if( $scope.find( '.gfield_radio .gchoice_button' ).length && ! $scope.hasClass( 'uael-gf-check-default-yes' ) && 'radio' == $scope.find( elem ).attr( 'type' ) ){ if( $scope.find( elem ).parent().hasClass( 'uael-radio-active') ){ $scope.find( elem ).parent().removeClass( 'uael-radio-active' ); } else { $scope.find( '.gchoice_button' ).removeClass( 'uael-radio-active' ); $scope.find( elem ).parent().addClass( 'uael-radio-active' ); } } }, 10, 3 ); } } /** * Function for Caldera Styler select field. * */ var WidgetUAELCafStylerHandler = function( $scope, $ ) { if ( 'undefined' == typeof $scope ) return; var cafSelectFields = $scope.find('select'); cafSelectFields.wrap( "
" ); checkRadioField( $scope ); $( document ).on( 'cf.add', function(){ checkRadioField( $scope ); }); // Check if custom span exists after radio field. function checkRadioField( $scope ) { $scope.find('input:radio').each(function() { var $this = $( this ); var radioField = $this.next().hasClass('uael-caf-radio-custom'); if( radioField ) { return; } else { $this.after( "" ); } }); } } /** * Function for CF7 Styler select field. * */ var WidgetUAELCF7StylerHandler = function( $scope, $ ) { if ( 'undefined' == typeof $scope ) return; var cf7SelectFields = $scope.find('select:not([multiple])'), cf7Loader = $scope.find('span.ajax-loader'); cf7SelectFields.wrap( "" ); cf7Loader.wrap( "
" ); var wpcf7event = document.querySelector( '.wpcf7' ); if( null !== wpcf7event ) { wpcf7event.addEventListener( 'wpcf7submit', function( event ) { var cf7ErrorFields = $scope.find('.wpcf7-not-valid-tip'); cf7ErrorFields.wrap( "" ); }, false ); } } /** * Function for Fancy Text animation. * */ var UAELFancyText = function() { var id = $( this ).data( 'id' ); var $this = $( this ).find( '.uael-fancy-text-node' ); var animation = $this.data( 'animation' ); var fancystring = $this.data( 'strings' ); var nodeclass = '.elementor-element-' + id; var typespeed = $this.data( 'type-speed' ); var backspeed = $this.data( 'back-speed' ); var startdelay = $this.data( 'start-delay' ); var backdelay = $this.data( 'back-delay' ); var loop = $this.data( 'loop' ); var showcursor = $this.data( 'show_cursor' ); var cursorchar = $this.data( 'cursor-char' ); var speed = $this.data('speed'); var pause = $this.data('pause'); var mousepause = $this.data('mousepause'); if ( 'type' == animation ) { $( nodeclass + ' .uael-typed-main' ).typed({ strings: fancystring, typeSpeed: typespeed, startDelay: startdelay, backSpeed: backspeed, backDelay: backdelay, loop: loop, showCursor: showcursor, cursorChar: cursorchar, }); } else if ( 'slide' == animation ) { $( nodeclass + ' .uael-fancy-text-slide' ).css( 'opacity', '1' ); $( nodeclass + ' .uael-slide-main' ).vTicker('init', { strings: fancystring, speed: speed, pause: pause, mousePause: mousepause, }); } else { UAELEffects._animateHeadline( $( nodeclass ).find( '.uael-slide-main_ul' ), $this ); } } /** * Hotspot Tooltip handler Function. * */ var WidgetUAELHotspotHandler = function( $scope, $ ) { if ( 'undefined' == typeof $scope ) { return; } var id = $scope.data( 'id' ); var $this = $scope.find( '.uael-hotspot-container' ); var side = $this.data( 'side' ); var trigger = $this.data( 'hotspottrigger' ); var arrow = $this.data( 'arrow' ); var distance = $this.data( 'distance' ); var delay = $this.data( 'delay' ); var animation = $this.data( 'animation' ); var anim_duration = $this.data( 'animduration' ); var uaelclass = 'uael-tooltip-wrap-' + id + ' uael-hotspot-tooltip'; var zindex = $this.data( 'zindex' ); var autoplay = $this.data( 'autoplay' ); var repeat = $this.data( 'repeat' ); var overlay = $this.data( 'overlay' ); var length = $this.data( 'length' ); var tour_interval = $this.data( 'tourinterval' ); var action_autoplay = $this.data( 'autoaction' ); var sid; var scrolling = false; var viewport_position = $this.data( 'hotspotviewport' ); var tooltip_maxwidth = $this.data( 'tooltip-maxwidth' ); var tooltip_minwidth = $this.data( 'tooltip-minwidth' ); if( 'custom' == trigger ) { passtrigger = 'click'; } else { passtrigger = trigger; } clearInterval( hotspotInterval[ id ] ); // Declare & pass values to Tooltipster js function. function tooltipsterCall( selector, triggerValue ) { $( selector ).tooltipster({ theme: ['tooltipster-noir', 'tooltipster-noir-customized'], minWidth: tooltip_minwidth, maxWidth: tooltip_maxwidth, side : side, trigger : triggerValue, arrow : arrow, distance : distance, delay : delay, animation : animation, uaelclass : uaelclass, zIndex : zindex, interactive : true, animationDuration : anim_duration, }); } // Disable prev & next nav for 1st & last tooltip. function tooltipNav() { if( 'yes' != repeat ) { $( ".uael-prev-" + id + '[data-tooltipid="1"]' ).addClass( "inactive" ); $( ".uael-next-" + id + '[data-tooltipid="' + length + '"]' ).addClass( "inactive" ); } } // Execute Tooltipster function tooltipsterCall( '.uael-hotspot-main-' + id, trigger ); // Tooltip execution for tour functionality. function sectionInterval() { hotspotInterval[ id ] = setInterval( function() { var $open_hotspot_node = $( '.uael-hotspot-main-' + id + '.open' ); sid = $open_hotspot_node.data( 'uaeltour' ); if( ! hoverFlag ) { $open_hotspot_node.trigger( 'click' ); if( 'yes' == repeat ) { if ( ! elementorFrontend.isEditMode() ) { if( sid == length ) { sid = 1; } else { sid = sid + 1; } $('.uael-hotspot-main-' + id + '[data-uaeltour="' + sid + '"]').trigger( 'click' ); $( window ).on( 'scroll', checkScroll ); function checkScroll() { if( !scrolling ) { scrolling = true; (!window.requestAnimationFrame) ? setTimeout(updateSections, 300) : window.requestAnimationFrame(updateSections); } } function updateSections() { var halfWindowHeight = $(window).height()/2, scrollTop = $(window).scrollTop(), section = $scope.find( '.uael-hotspot-container' ); if( ! (section.offset().top - halfWindowHeight < scrollTop ) && ( section.offset().top + section.height() - halfWindowHeight > scrollTop) ) { } else { var hotspot_main = $( '.uael-hotspot-main-' + id + '.open' ); hotspot_main.tooltipster( 'close' ); hotspot_main.removeClass( 'open' ); clearInterval( hotspotInterval[ id ] ); buttonOverlay(); $( overlay_id ).show(); } scrolling = false; } } else { if( sid < length ) { sid = sid + 1; $('.uael-hotspot-main-' + id + '[data-uaeltour="' + sid + '"]').trigger( 'click' ); } else if( sid == length ) { clearInterval( hotspotInterval[ id ] ); buttonOverlay(); $( overlay_id ).show(); } } } else if( 'no' == repeat ) { if( sid < length ) { sid = sid + 1; $( '.uael-hotspot-main-' + id + '[data-uaeltour="' + sid + '"]' ).trigger( 'click' ); } else if( sid == length ) { clearInterval( hotspotInterval[ id ] ); buttonOverlay(); $( overlay_id ).show(); } } } tour_interval = $( '.uael-hotspot-container' ).data( 'tourinterval' ); tour_interval = parseInt( tour_interval ); }, tour_interval ); } // Execute Tooltip execution for tour functionality function tourPlay() { clearInterval( hotspotInterval[ id ] ); // Open previous tooltip on trigger $( '.uael-prev-' + id ).off('click.prevtrigger').on( 'click.prevtrigger', function(e) { clearInterval( hotspotInterval[ id ] ); var sid = $(this).data( 'tooltipid' ); if( sid <= length ) { $( '.uael-hotspot-main-' + id + '[data-uaeltour="' + sid + '"]' ).trigger( 'click' ); if( 'yes' == repeat ) { if( sid == 1 ) { sid = length + 1; } } sid = sid - 1; $( '.uael-hotspot-main-' + id + '[data-uaeltour="' + sid + '"]' ).trigger( 'click' ); } if( 'yes' == autoplay ) { sectionInterval(); } }); // Open next tooltip on trigger $( '.uael-next-' + id ).off('click.nexttrigger').on( 'click.nexttrigger', function(e) { clearInterval( hotspotInterval[ id ] ); var sid = $(this).data( 'tooltipid' ); if( sid <= length ) { $( '.uael-hotspot-main-' + id + '[data-uaeltour="' + sid + '"]' ).trigger( 'click' ); if( 'yes' == repeat ) { if( sid == length ) { sid = 0; } } sid = sid + 1; $( '.uael-hotspot-main-' + id + '[data-uaeltour="' + sid + '"]' ).trigger( 'click' ); } if( 'yes' == autoplay ) { sectionInterval(); } }); $( '.uael-tour-end-' + id ).off('click.endtour').on( 'click.endtour', function(e) { clearInterval( hotspotInterval[ id ] ); e.preventDefault(); var hotspot_main = $( '.uael-hotspot-main-' + id + '.open' ); hotspot_main.tooltipster( 'close' ); hotspot_main.removeClass( 'open' ); if( 'auto' == action_autoplay && 'yes' == autoplay ) { $( '.uael-hotspot-main-' + id ).css( "pointer-events", "none" ); } else { buttonOverlay(); $( overlay_id ).show(); } }); // Add & remove open class for tooltip. $( '.uael-hotspot-main-' + id ).off('click.triggertour').on('click.triggertour', function(e) { var $this = $(this); if ( ! $this.hasClass('open') ) { $this.tooltipster( 'open' ); $this.addClass( 'open' ); if( 'yes' == autoplay ) { $this.css( "pointer-events", "visible" ); $( '.uael-hotspot-main-' + id + '.open' ).on( 'mouseenter mouseleave', function(){ hoverFlag = true; }, function(){ hoverFlag = false; }); } } else { $this.tooltipster( 'close' ); $this.removeClass( 'open' ); if( 'yes' == autoplay ) { $this.css( "pointer-events", "none" ); } } }); //Initialy open first tooltip by default. if( 'yes' == autoplay ) { $( '.uael-hotspot-main-' + id ).css( "pointer-events", "none" ); tooltipNav(); $( '.uael-hotspot-main-' + id + '[data-uaeltour="1"]' ).trigger( 'click' ); sectionInterval(); } else if( 'no' == autoplay ) { $( '.uael-hotspot-main-' + id ).css( "pointer-events", "none" ); tooltipNav(); $( '.uael-hotspot-main-' + id + '[data-uaeltour="1"]' ).trigger( 'click' ); } } // Add button overlay when tour ends. function buttonOverlay() { if( 'custom' == trigger ) { if( 'yes' == overlay ) { if( 'yes' == autoplay ) { var overlay_id = $scope.find( '.uael-hotspot-overlay' ); var button_id = $scope.find( '.uael-overlay-button' ); if( ! isElEditMode ) { $( button_id ).off().on( 'click', function(e) { $( overlay_id ).hide(); tourPlay(); }); } } } else if( 'auto' == action_autoplay && 'yes' == autoplay ) { if( ! isElEditMode ) { if( typeof elementorFrontend.waypoint !== 'undefined' ) { elementorFrontend.waypoint( $this, tourPlay, { offset: viewport_position + '%' } ); } } } else { tourPlay(); } } } // Start of hotspot functionality. if( 'custom' == trigger ) { var overlay_id = $scope.find( '.uael-hotspot-overlay' ); buttonOverlay(); } else { clearInterval( hotspotInterval[ id ] ); } } /** * Price Table Tooltip handler Function. * */ var WidgetUAELPriceTableHandler = function( $scope, $ ) { if ( 'undefined' == typeof $scope ) { return; } var id = $scope.data( 'id' ); var $this = $scope.find( '.uael-price-table-features-list' ); var side = $this.data( 'side' ); var trigger = $this.data( 'hotspottrigger' ); var arrow = $this.data( 'arrow' ); var distance = $this.data( 'distance' ); var delay = $this.data( 'delay' ); var animation = $this.data( 'animation' ); var anim_duration = $this.data( 'animduration' ); var uaelclass = 'uael-price-table-wrap-' + id; var uaelclassStrikeTooltip = 'uael-price-table-wrap-' + id; var zindex = $this.data( 'zindex' ); var length = $this.data( 'length' ); var tooltip_maxwidth = $this.data( 'tooltip-maxwidth' ); var tooltip_minwidth = $this.data( 'tooltip-minwidth' ); var responsive = $this.data( 'tooltip-responsive' ); var enable_tooltip = $this.data( 'enable-tooltip' ); var pricing_container = $scope.find( '.uael-pricing-container' ); var strike_tooltip = pricing_container.data( 'strike-tooltip' ); var strike_tooltip_position = pricing_container.data( 'strike-tooltip-position' ); var strike_tooltip_hide = pricing_container.data( 'strike-tooltip-hide' ); uaelclass += ' uael-price-table-tooltip uael-features-tooltip-hide-' + responsive; $this.addClass( 'uael-features-tooltip-hide-' + responsive ); uaelclassStrikeTooltip += ' uael-strike-price-tooltip uael-strike-tooltip-hide-' + strike_tooltip_hide; $this.addClass( 'uael-strike-tooltip-hide-' + strike_tooltip_hide ); // Declare & pass values to Tooltipster js function. function tableTooltipsterCall( selector, triggerValue ) { $( selector ).tooltipster({ theme: ['tooltipster-noir', 'tooltipster-noir-customized'], minWidth: tooltip_minwidth, maxWidth: tooltip_maxwidth, side : side, trigger : triggerValue, arrow : arrow, distance : distance, delay : delay, animation : animation, zIndex : zindex, interactive : true, animationDuration : anim_duration, uaelclass: uaelclass }); } if( 'yes' === enable_tooltip ){ // Execute Tooltipster function tableTooltipsterCall( '.uael-price-table-content-' + id, trigger ); } if ( 'yes' === strike_tooltip ) { $( '.uael-strike-tooltip' ).tooltipster( { theme: ['tooltipster-noir', 'tooltipster-noir-customized'], side : strike_tooltip_position, trigger : 'hover', arrow : true, distance : 6, delay : 300, animation : 'fade', zIndex : 99, interactive : true, animationDuration : 350, uaelclass: uaelclass } ); } } /** * Before After Slider handler Function. * */ var WidgetUAELBASliderHandler = function( $scope, $ ) { if ( 'undefined' == typeof $scope ) return; var selector = $scope.find( '.uael-ba-container' ); var initial_offset = selector.data( 'offset' ); var move_on_hover = selector.data( 'move-on-hover' ); var orientation = selector.data( 'orientation' ); $scope.css( 'width', '' ); $scope.css( 'height', '' ); if( 'yes' == move_on_hover ) { move_on_hover = true; } else { move_on_hover = false; } $scope.imagesLoaded( function() { UAELBASlider( $scope ); $scope.find( '.uael-ba-container' ).twentytwenty( { default_offset_pct: initial_offset, move_on_hover: move_on_hover, orientation: orientation } ); $( window ).on( 'resize', function( e ) { UAELBASlider( $scope ); } ); } ); }; /** * Fancy text handler Function. * */ var WidgetUAELFancyTextHandler = function( $scope, $ ) { if ( 'undefined' == typeof $scope ) { return; } var node_id = $scope.data( 'id' ); var viewport_position = 90; var selector = $( '.elementor-element-' + node_id ); var current_device = elementorFrontend.getCurrentDeviceMode(); if( 'mobile' === current_device ) { viewport_position = 100; } if( typeof elementorFrontend.waypoint !== 'undefined' ) { elementorFrontend.waypoint( selector, UAELFancyText, { offset: viewport_position + '%' } ); } }; /** * * Timeline handler Function. * */ var WidgetUAELTimelineHandler = function( $scope, $ ) { if ( 'undefined' == typeof $scope ) return; // Define variables. var $this = $scope.find( '.uael-timeline-node' ); var timeline_main = $scope.find(".uael-timeline-main"); if ( timeline_main.length < 1 ) { return false; } var animate_border = $scope.find(".animate-border"); var timeline_icon = $scope.find(".uael-timeline-marker"); var line_inner = $scope.find(".uael-timeline__line__inner"); var line_outer = $scope.find(".uael-timeline__line"); var $icon_class = $scope.find(".uael-timeline-marker"); var $card_last = $scope.find(".uael-timeline-field:last-child"); var timeline_start_icon = $icon_class.first().position(); var timeline_end_icon = $icon_class.last().position(); line_outer.css('top', timeline_start_icon.top ); var timeline_card_height = $card_last.height(); var last_item_top = $card_last.offset().top - $this.offset().top; var $last_item, parent_top; if( $scope.hasClass('uael-timeline-arrow-center')) { line_outer.css('bottom', timeline_end_icon.top ); parent_top = last_item_top - timeline_start_icon.top; $last_item = parent_top + timeline_end_icon.top; } else if( $scope.hasClass('uael-timeline-arrow-top')) { var top_height = timeline_card_height - timeline_end_icon.top; line_outer.css('bottom', top_height ); $last_item = last_item_top; } else if( $scope.hasClass('uael-timeline-arrow-bottom')) { var bottom_height = timeline_card_height - timeline_end_icon.top; line_outer.css('bottom', bottom_height ); parent_top = last_item_top - timeline_start_icon.top; $last_item = parent_top + timeline_end_icon.top; } var elementEnd = $last_item + 20; var initial_height = 0; line_inner.height(initial_height); var num = 0; // Callback function for all event listeners. function uaelTimelineFunc() { timeline_main = $scope.find(".uael-timeline-main"); if ( timeline_main.length < 1 ) { return false; } var $document = $(document); // Repeat code for window resize event starts. timeline_start_icon = $icon_class.first().position(); timeline_end_icon = $icon_class.last().position(); $card_last = $scope.find(".uael-timeline-field").last(); line_outer.css('top', timeline_start_icon.top ); timeline_card_height = $card_last.height(); last_item_top = $card_last.offset().top - $this.offset().top; if( $scope.hasClass('uael-timeline-arrow-center')) { line_outer.css('bottom', timeline_end_icon.top ); parent_top = last_item_top - timeline_start_icon.top; $last_item = parent_top + timeline_end_icon.top; } else if( $scope.hasClass('uael-timeline-arrow-top')) { var top_height = timeline_card_height - timeline_end_icon.top; line_outer.css('bottom', top_height ); $last_item = last_item_top; } else if( $scope.hasClass('uael-timeline-arrow-bottom')) { var bottom_height = timeline_card_height - timeline_end_icon.top; line_outer.css('bottom', bottom_height ); parent_top = last_item_top - timeline_start_icon.top; $last_item = parent_top + timeline_end_icon.top; } elementEnd = $last_item + 20; // Repeat code for window resize event ends. var viewportHeight = document.documentElement.clientHeight; var viewportHeightHalf = viewportHeight/2; var elementPos = $this.offset().top; var new_elementPos = elementPos + timeline_start_icon.top; var photoViewportOffsetTop = new_elementPos - $document.scrollTop(); if (photoViewportOffsetTop < 0) { photoViewportOffsetTop = Math.abs(photoViewportOffsetTop); } else { photoViewportOffsetTop = -Math.abs(photoViewportOffsetTop); } if ( elementPos < (viewportHeightHalf) ) { if ( (viewportHeightHalf) + Math.abs(photoViewportOffsetTop) < (elementEnd) ) { line_inner.height((viewportHeightHalf) + photoViewportOffsetTop); }else{ if ( (photoViewportOffsetTop + viewportHeightHalf) >= elementEnd ) { line_inner.height(elementEnd); } } } else { if ( (photoViewportOffsetTop + viewportHeightHalf) < elementEnd ) { if (0 > photoViewportOffsetTop) { line_inner.height((viewportHeightHalf) - Math.abs(photoViewportOffsetTop)); ++num; } else { line_inner.height((viewportHeightHalf) + photoViewportOffsetTop); } } else { if ( (photoViewportOffsetTop + viewportHeightHalf) >= elementEnd ) { line_inner.height(elementEnd); } } } var timeline_icon_pos, timeline_card_pos; var elementPos, elementCardPos; var timeline_icon_top, timeline_card_top; timeline_icon = $scope.find(".uael-timeline-marker"); animate_border = $scope.find(".animate-border"); for (var i = 0; i < timeline_icon.length; i++) { timeline_icon_pos = $(timeline_icon[i]).offset().top; timeline_card_pos = $(animate_border[i]).offset().top; elementPos = $this.offset().top; elementCardPos = $this.offset().top; timeline_icon_top = timeline_icon_pos - $document.scrollTop(); timeline_card_top = timeline_card_pos - $document.scrollTop(); if ( ( timeline_card_top ) < ( ( viewportHeightHalf ) ) ) { animate_border[i].classList.remove("out-view"); animate_border[i].classList.add("in-view"); } else { // Remove classes if element is below than half of viewport. animate_border[i].classList.add("out-view"); animate_border[i].classList.remove("in-view"); } if ( ( timeline_icon_top ) < ( ( viewportHeightHalf ) ) ) { // Add classes if element is above than half of viewport. timeline_icon[i].classList.remove("out-view-timeline-icon"); timeline_icon[i].classList.add("in-view-timeline-icon"); } else { // Remove classes if element is below than half of viewport. timeline_icon[i].classList.add("out-view-timeline-icon"); timeline_icon[i].classList.remove("in-view-timeline-icon"); } } } // Listen for events. window.addEventListener("load", uaelTimelineFunc); window.addEventListener("resize", uaelTimelineFunc); window.addEventListener("scroll", uaelTimelineFunc); window.addEventListener("click", function() { uaelTimelineFunc(); }); var post_selector = $scope.find( '.uael-days' ); var node_id = $scope.data( 'id' ); if ( post_selector.hasClass( 'uael-timeline-infinite-load' ) ) { $( window ).scroll( function(){ $('.elementor-element-' + node_id + ' .uael-timeline-wrapper').jscroll({ loadingHtml: '', nextSelector: '#uael-timeline-' + node_id + ' a.next', contentSelector: '.elementor-element-' + node_id + ' .uael-timeline-main', callback: function() { window.addEventListener("load", uaelTimelineFunc); window.addEventListener("resize", uaelTimelineFunc); window.addEventListener("scroll", uaelTimelineFunc); } }); }); } }; /* * * Radio Button Switcher JS Function. * */ var WidgetUAELContentToggleHandler = function( $scope, $ ) { if ( 'undefined' == typeof $scope ) { return; } var rbs_section_1 = $scope.find( ".uael-rbs-section-1" ); var rbs_section_2 = $scope.find( ".uael-rbs-section-2" ); var main_btn = $scope.find( ".uael-main-btn" ); var switch_type = main_btn.attr( 'data-switch-type' ); var rbs_label_1 = $scope.find( ".uael-sec-1" ); var rbs_label_2 = $scope.find( ".uael-sec-2" ); var current_class; switch ( switch_type ) { case 'round_1': current_class = '.uael-switch-round-1'; break; case 'round_2': current_class = '.uael-switch-round-2'; break; case 'rectangle': current_class = '.uael-switch-rectangle'; break; case 'label_box': current_class = '.uael-switch-label-box'; break; default: current_class = 'No Class Selected'; break; } var rbs_switch = $scope.find( current_class ); if( '' !== id && sanitize_input ){ if ( id === 'content-1' || id === 'content-2' ) { UAELContentToggle._openOnLink( $scope, rbs_switch ); } } setTimeout( function(){ if( rbs_switch.is( ':checked' ) ) { rbs_section_1.hide(); rbs_section_2.show(); } else { rbs_section_1.show(); rbs_section_2.hide(); } }, 100 ); rbs_switch.on( 'click', function(e){ rbs_section_1.toggle(); rbs_section_2.toggle(); }); /* Label 1 Click */ rbs_label_1.on( 'click', function(e){ // Uncheck rbs_switch.prop( "checked", false); rbs_section_1.show(); rbs_section_2.hide(); }); /* Label 2 Click */ rbs_label_2.on('click', function(e){ // Check rbs_switch.prop( "checked", true); rbs_section_1.hide(); rbs_section_2.show(); }); }; UAELContentToggle = { /** * Open specific section on click of link * */ _openOnLink: function( $scope, rbs_switch ){ var node_id = $scope.data( 'id' ); var node = '.elementor-element-' + node_id; var node_toggle = '#uael-toggle-init' + node; $( 'html, body' ).animate( { scrollTop: $( '#uael-toggle-init' ).find( '.uael-rbs-wrapper' ).offset().top }, 500 ); if( id === 'content-1' ) { $( node_toggle + ' .uael-rbs-content-1' ).show(); $( node_toggle + ' .uael-rbs-content-2' ).hide(); rbs_switch.prop( "checked", false ); } else { $( node_toggle + ' .uael-rbs-content-2' ).show(); $( node_toggle + ' .uael-rbs-content-1' ).hide(); rbs_switch.prop( "checked", true ); } } } /** * Video Gallery handler Function. * */ var WidgetUAELVideoGalleryHandler = function( $scope, $ ) { if ( 'undefined' == typeof $scope ) { return; } var selector = $scope.find( '.uael-video-gallery-wrap' ); var layout = selector.data( 'layout' ); var action = selector.data( 'action' ); var all_filters = selector.data( 'all-filters' ); var $tabs_dropdown = $scope.find('.uael-filters-dropdown-list'); if ( selector.length < 1 ) { return; } if ( 'lightbox' == action ) { $scope.find( '.uael-vg__play_full' ).fancybox(); } else if ( 'inline' == action ) { $scope.find( '.uael-vg__play_full' ).on( 'click', function( e ) { e.preventDefault(); var iframe = $( "