/** * Javascript to handle Google Map for contact pages. */ ( function ( $ ) { "use strict"; const mapContainer = document.getElementById( "map_canvas" ); if ( typeof contactMapData === "undefined" && mapContainer === null ) { return; } if ( ! contactMapData.lat && ! contactMapData.lng ) { return; } const officeLocation = new google.maps.LatLng( parseFloat( contactMapData.lat ), parseFloat( contactMapData.lng ) ); let styles, mapZoom = 14; if ( contactMapData.zoom ) { mapZoom = parseInt( contactMapData.zoom ); } if ( rhMapsData.isUltra ) { styles = [{ "featureType" : "landscape.natural", "stylers" : [{ "color" : "#bcddff" }] }, { "featureType" : "road.highway", "elementType" : "geometry.fill", "stylers" : [{ "color" : "#5fb3ff" }] }, { "featureType" : "road.arterial", "stylers" : [{ "color" : "#ebf4ff" }] }, { "featureType" : "road.local", "elementType" : "geometry.fill", "stylers" : [{ "color" : "#ebf4ff" }] }, { "featureType" : "road.local", "elementType" : "geometry.stroke", "stylers" : [{ "visibility" : "on" }, { "color" : "#93c8ff" }] }, { "featureType" : "landscape.man_made", "elementType" : "geometry", "stylers" : [{ "color" : "#c7e2ff" }] }, { "featureType" : "transit.station.airport", "elementType" : "geometry", "stylers" : [{ "saturation" : 100 }, { "gamma" : 0.82 }, { "hue" : "#0088ff" }] }, { "elementType" : "labels.text.fill", "stylers" : [{ "color" : "#1673cb" }] }, { "featureType" : "road.highway", "elementType" : "labels.icon", "stylers" : [{ "saturation" : 58 }, { "hue" : "#006eff" }] }, { "featureType" : "poi", "elementType" : "geometry", "stylers" : [{ "color" : "#4797e0" }] }, { "featureType" : "poi.park", "elementType" : "geometry", "stylers" : [{ "color" : "#209ee1" }, { "lightness" : 49 }] }, { "featureType" : "transit.line", "elementType" : "geometry.fill", "stylers" : [{ "color" : "#83befc" }] }, { "featureType" : "road.highway", "elementType" : "geometry.stroke", "stylers" : [{ "color" : "#3ea3ff" }] }, { "featureType" : "administrative", "elementType" : "geometry.stroke", "stylers" : [{ "saturation" : 86 }, { "hue" : "#0077ff" }, { "weight" : 0.8 }] }, { "elementType" : "labels.icon", "stylers" : [{ "hue" : "#0066ff" }, { "weight" : 1.9 }] }, { "featureType" : "poi", "elementType" : "geometry.fill", "stylers" : [{ "hue" : "#0077ff" }, { "saturation" : -7 }, { "lightness" : 24 }] }, { "featureType" : "water", "elementType" : "all", "stylers" : [{ "color" : contactMapData.mapWaterColor }, { "visibility" : "on" }] }]; } else if ( rhMapsData.isModern ) { styles = [{ "featureType" : "administrative", "elementType" : "labels.text", "stylers" : [{ "color" : "#000000" }] }, { "featureType" : "administrative", "elementType" : "labels.text.fill", "stylers" : [{ "color" : "#444444" }] }, { "featureType" : "administrative", "elementType" : "labels.text.stroke", "stylers" : [{ "visibility" : "off" }] }, { "featureType" : "administrative", "elementType" : "labels.icon", "stylers" : [{ "visibility" : "on" }, { "color" : "#380d0d" }] }, { "featureType" : "landscape", "elementType" : "all", "stylers" : [{ "color" : "#f2f2f2" }] }, { "featureType" : "poi", "elementType" : "all", "stylers" : [{ "visibility" : "off" }] }, { "featureType" : "road", "elementType" : "all", "stylers" : [{ "saturation" : -100 }, { "lightness" : 45 }] }, { "featureType" : "road", "elementType" : "geometry", "stylers" : [{ "visibility" : "on" }, { "color" : "#dedddb" }] }, { "featureType" : "road", "elementType" : "labels.text", "stylers" : [{ "color" : "#000000" }] }, { "featureType" : "road", "elementType" : "labels.text.fill", "stylers" : [{ "color" : "#1f1b1b" }] }, { "featureType" : "road", "elementType" : "labels.text.stroke", "stylers" : [{ "visibility" : "off" }] }, { "featureType" : "road", "elementType" : "labels.icon", "stylers" : [{ "visibility" : "on" }, { "hue" : "#ff0000" }] }, { "featureType" : "road.highway", "elementType" : "all", "stylers" : [{ "visibility" : "simplified" }] }, { "featureType" : "road.arterial", "elementType" : "labels.icon", "stylers" : [{ "visibility" : "off" }] }, { "featureType" : "transit", "elementType" : "all", "stylers" : [{ "visibility" : "off" }] }, { "featureType" : "water", "elementType" : "all", "stylers" : [{ "color" : contactMapData.mapWaterColor }, { "visibility" : "on" }] }]; } const contactMapOptions = { center : officeLocation, zoom : mapZoom, scrollwheel : false, styles : styles }; // Map Styles if ( undefined !== contactMapData.styles ) { contactMapOptions.styles = JSON.parse( contactMapData.styles ); } // Setting Google Map Type switch ( contactMapData.type ) { case 'satellite': contactMapOptions.mapTypeId = google.maps.MapTypeId.SATELLITE; break; case 'hybrid': contactMapOptions.mapTypeId = google.maps.MapTypeId.HYBRID; break; case 'terrain': contactMapOptions.mapTypeId = google.maps.MapTypeId.TERRAIN; break; default: contactMapOptions.mapTypeId = google.maps.MapTypeId.ROADMAP; } let iconURL = ""; if ( contactMapData.iconURL ) { iconURL = contactMapData.iconURL; } const contactMap = new google.maps.Map( mapContainer, contactMapOptions ), contactMarker = new google.maps.Marker( { position : officeLocation, map : contactMap, icon : iconURL } ); } )( jQuery );; /** * JavaScript Related to Search Form */ (function ($) { "use strict"; /** * Change Min and Max Price fields based on selected status for rent */ if ( localizedSearchParams.rent_slug !== undefined) { var property_status_changed = function (new_status) { var price_for_others = $('.advance-search-form .price-for-others'); var price_for_rent = $('.advance-search-form .price-for-rent'); if (price_for_others.length > 0 && price_for_rent.length > 0) { if (new_status == localizedSearchParams.rent_slug) { price_for_others.addClass('hide-fields').find('select').prop('disabled', true); price_for_rent.removeClass('hide-fields').find('select').prop('disabled', false); } else { price_for_rent.addClass('hide-fields').find('select').prop('disabled', true); price_for_others.removeClass('hide-fields').find('select').prop('disabled', false); } } } $('.advance-search-form #select-status').change(function (e) { var selected_status = $(this).val(); property_status_changed(selected_status); }); /* On page load ( as on search page ) */ var selected_status = $('.advance-search-form #select-status').val(); if (selected_status == localizedSearchParams.rent_slug) { property_status_changed(selected_status); } } /** * Max and Min Price * Shows red outline if min price is bigger than max price */ /* for normal prices */ $('#select-min-price,#select-max-price').change(function (obj, e) { var min_text_val = $('#select-min-price').val(); var min_int_val = (isNaN(min_text_val)) ? 0 : parseInt(min_text_val); var max_text_val = $('#select-max-price').val(); var max_int_val = (isNaN(max_text_val)) ? 0 : parseInt(max_text_val); if ((min_int_val >= max_int_val) && (min_int_val != 0) && (max_int_val != 0)) { $('#select-min-price,#select-max-price').siblings('button.dropdown-toggle').css('outline', '1px solid red'); } else { $('#select-min-price,#select-max-price').siblings('button.dropdown-toggle').css('outline', 'none'); } }); /* for rent prices */ $('#select-min-price-for-rent, #select-max-price-for-rent').change(function (obj, e) { var min_text_val = $('#select-min-price-for-rent').val(); var min_int_val = (isNaN(min_text_val)) ? 0 : parseInt(min_text_val); var max_text_val = $('#select-max-price-for-rent').val(); var max_int_val = (isNaN(max_text_val)) ? 0 : parseInt(max_text_val); if ((min_int_val >= max_int_val) && (min_int_val != 0) && (max_int_val != 0)) { $('#select-min-price-for-rent, #select-max-price-for-rent').siblings('button.dropdown-toggle').css('outline', '1px solid red'); } else { $('#select-min-price-for-rent, #select-max-price-for-rent').siblings('button.dropdown-toggle').css('outline', 'none'); } }); /** * Max and Min Area * To show red outline if min is bigger than max */ $('#min-area,#max-area').change(function (obj, e) { var min_text_val = $('#min-area').val(); var min_int_val = (isNaN(min_text_val)) ? 0 : parseInt(min_text_val); var max_text_val = $('#max-area').val(); var max_int_val = (isNaN(max_text_val)) ? 0 : parseInt(max_text_val); if ((min_int_val >= max_int_val) && (min_int_val != 0) && (max_int_val != 0)) { $('#min-area,#max-area').css('outline', '1px solid red'); } else { $('#min-area,#max-area').css('outline', 'none'); } }); /** * Disable empty values on submission to reduce query string size */ $('.advance-search-form').submit(function (event) { var searchFormElements = $(this).find(':input'); $.each(searchFormElements, function (index, element) { if (element.value == '' || element.value == 'any') { if (!element.disabled) { element.disabled = true; } } }); }); /** * Add to compare -- Search Page */ function removeBorder () { let screenWidth = $(window).width(); let isRtl = $('body').hasClass('rtl'); if ((979 < screenWidth && 1200 > screenWidth) || (767 >= screenWidth && 500 <= screenWidth)) { if (!isRtl) { let addToCompareSpan = $('.page-template-template-search .property-item .compare-meta span.add-to-compare-span').length; if (addToCompareSpan) { $('.page-template-template-search .property-item .compare-meta span').css({ 'border': 'none' }); $('.page-template-template-search .property-item .compare-meta span.add-to-compare-span').css({ 'margin-right': '-20px', 'border-left': 'none' }); } } else { let addToCompareSpan = $('.page-template-template-search .property-item .compare-meta span.add-to-compare-span').length; if (addToCompareSpan) { $('.page-template-template-search .property-item .compare-meta span').css({ 'border-left': 'none' }); $('.page-template-template-search .property-item .compare-meta span.add-to-compare-span').css({ 'margin-left': '-20px', 'border-right': 'none', 'float': 'left' }); } } } else if (500 <= screenWidth) { if (!isRtl) { let addToCompareSpan = $('.page-template-template-search .property-item .compare-meta span.add-to-compare-span').length; if (addToCompareSpan) { $('.page-template-template-search .property-item .compare-meta span:nth-last-child(2)').css({ 'border': 'none' }); $('.page-template-template-search .property-item .compare-meta span.add-to-compare-span').css({ 'margin-right': '-20px', 'border-left': '1px solid #dedede' }); } } else { let addToCompareSpan = $('.page-template-template-search .property-item .compare-meta span.add-to-compare-span').length; if (addToCompareSpan) { $('.page-template-template-search .property-item .compare-meta span:nth-last-child(2)').css({ 'border': 'none' }); $('.page-template-template-search .property-item .compare-meta span.add-to-compare-span').css({ 'margin-left': '-20px', 'border-right': '1px solid #dedede', 'float': 'left' }); } } } else { if (!isRtl) { let addToCompareSpan = $('.page-template-template-search .property-item .compare-meta span.add-to-compare-span').length; if (addToCompareSpan) { $('.page-template-template-search .property-item .compare-meta span.add-to-compare-span').css({ 'margin-right': '0', 'border-left': 'none' }); } } else { let addToCompareSpan = $('.page-template-template-search .property-item .compare-meta span.add-to-compare-span').length; if (addToCompareSpan) { $('.page-template-template-search .property-item .compare-meta span.add-to-compare-span').css({ 'margin-right': '0', 'border-left': 'none', 'float': 'right' }); } } } } removeBorder(); /* Execute again on window resize. */ $(window).on('resize', function () { removeBorder(); }); /** * Ajax Search for keyword in Search Form */ $(document).ready(function () { $('#keyword-txt').keyup(function () { var words = $(this).val().split(' '); var wordcounts = words.length; if (wordcounts > 1) { $('.rh_sfoi_data_fetch_list').slideDown(); $('.rh_sfoi_ajax_loader').show(); $.ajax({ url: frontEndAjaxUrl.sfoiajaxurl, type: 'POST', data: { action: 'rh_sfoi_data_fetch', keyword: $(this).val() }, success: function (data) { $('.rh_sfoi_data_fetch_list').html(data); $('.rh_sfoi_ajax_loader').hide(); } }); } else { $('.rh_sfoi_data_fetch_list').slideUp(); } }); }); })(jQuery); ; ( function ( $ ) { "use strict"; const $window = $( window ), $body = $( 'body' ), isRtl = $body.hasClass( 'rtl' ); /** * Sticky footer related code. */ function footerStick() { $( '.rh_wrap_stick_footer' ).css( 'padding-bottom', $( '.rh_sticky_wrapper_footer' ).outerHeight() + 'px' ) } /** * Form AJAX validation and submission * Validation Plugin : https://jqueryvalidation.org/ * Form Ajax Plugin : http://www.malsup.com/jquery/form/ * * @since 4.0.0 */ function realhomesValidateForm( form_id ) { const form = $( form_id ); if ( ! form.length ) { return false; } const submitButton = form.find( '.submit-button' ), ajaxLoader = form.find( '.ajax-loader' ), messageContainer = form.find( '.message-container' ), errorContainer = form.find( ".error-container" ), formOptions = { beforeSubmit : function () { submitButton.attr( 'disabled', 'disabled' ); ajaxLoader.fadeIn( 'fast' ); messageContainer.fadeOut( 'fast' ); errorContainer.fadeOut( 'fast' ); }, success : function ( ajax_response, statusText, xhr, $form ) { const response = $.parseJSON( ajax_response ); ajaxLoader.fadeOut( 'fast' ); submitButton.removeAttr( 'disabled' ); if ( response.success ) { form.resetForm(); messageContainer.html( response.message ).fadeIn( 'fast' ); // call reset function if it exists if ( typeof inspiryResetReCAPTCHA == 'function' ) { inspiryResetReCAPTCHA(); } if ( typeof contactFromData !== 'undefined' ) { setTimeout( function () { window.location.replace( contactFromData.redirectPageUrl ); }, 1000 ); } else { setTimeout( function () { messageContainer.fadeOut( 'slow' ) }, 3000 ); } } else { errorContainer.html( response.message ).fadeIn( 'fast' ); } } }; if ( jQuery().validate && jQuery().ajaxSubmit ) { form.validate( { errorLabelContainer : errorContainer, submitHandler : function ( form ) { $( form ).ajaxSubmit( formOptions ); } } ); } } // Contact form realhomesValidateForm( '#contact-form' ); // Agent contact form realhomesValidateForm( '#agent-single-form' ); // Agency contact form realhomesValidateForm( '#agency-single-form' ); // Schedule A Tour form realhomesValidateForm( '#schedule-a-tour' ); /** * Sticky Header * * @since 4.0.0 */ $( function () { const stickyHeader = $( '.rh-sticky-header' ); if ( stickyHeader.length ) { const headerHeight = stickyHeader.height(); $window.on( 'scroll', function () { let $this = $( this ); if ( $this.width() > 1024 ) { if ( $this.scrollTop() > ( headerHeight + 100 ) ) { stickyHeader.addClass( 'sticked' ); } else { stickyHeader.removeClass( 'sticked' ); } } } ); } } ); $( document ).ready( function () { /** * Datepicker for Single Property */ let singleProperty = document.querySelector( '.single-property' ); if ( singleProperty ) { let satForm = document.getElementById( 'schedule-a-tour' ); if ( satForm ) { $( "#sat-date" ).datepicker( { minDate : 0, showAnim : 'slideDown', beforeShow : function ( input, inst ) { inst.dpDiv[0].classList.add( 'schedule-section-wrapper' ); } } ); } } /** * Sliders */ if ( jQuery().flexslider ) { // Gallery Post Slider const galleryPostSlider = $( '.gallery-post-slider' ); if ( galleryPostSlider.length ) { galleryPostSlider.flexslider( { animation : "slide", slideshow : false, controlNav : false, prevText : "", nextText : "", start : function ( slider ) { galleryPostSlider.find( '.clone' ).children().removeAttr( "data-fancybox" ); } } ); } } /** * Single Property Slider */ var singlePropertySlider = $( '.rh-ultra-property-slider' ); var singlePropertyCarousel = $( '.rh-ultra-horizontal-carousel-trigger' ); var singlePropertyVerticalCarousel = $( '.rh-ultra-vertical-carousel-trigger' ); // Responsive Nav $( '.rh-ultra-responsive-nav' ).hcOffcanvasNav( { disableAt : 1139, insertClose : true, insertBack : true, labelClose : mobileNavLabels.labelClose, labelBack : mobileNavLabels.labelBack, levelSpacing : 40, // levelTitleAsBack: true, // pushContent: '.rh_section', customToggle : '.rh-responsive-toggle' } ); // TODO: Dynamic Slides counter in future // if ( singlePropertySlider.length ) { // var currentSlide; // var slidesCount; // var sliderCounter = $( '.rh-slider-item-total' ); // // var rhUpdateSliderCounter = function ( slick, currentIndex ) { // // currentSlide = slick.slickCurrentSlide() + 1; // slidesCount = slick.slideCount; // // jQuery(sliderCounter).text(currentSlide + '/' + slidesCount) // // // if ( currentSlide - slidesCount !== 0 ) { // $( sliderCounter ).text( slidesCount - currentSlide ); // } else { // $( sliderCounter ).text( slidesCount ); // } // }; // // singlePropertySlider.on( 'init', function ( event, slick ) { // // $slider.append(sliderCounter); // rhUpdateSliderCounter( slick ); // } ); // // singlePropertySlider.on( 'afterChange', function ( event, slick, currentSlide ) { // rhUpdateSliderCounter( slick, currentSlide ); // } ); // // } let syncEnable = ''; let centerMode = false; singlePropertyCarousel.on( 'init', function ( event, slick ) { if ( singlePropertyCarousel.data( 'count' ) > singlePropertyCarousel.find( '.slick-active' ).length ) { syncEnable = singlePropertyCarousel; centerMode = true; } } ); singlePropertyVerticalCarousel.on( 'init', function ( event, slick ) { if ( singlePropertyVerticalCarousel.data( 'count' ) > singlePropertyVerticalCarousel.find( '.slick-active' ).length ) { syncEnable = singlePropertyCarousel; centerMode = true; } } ); singlePropertySlider.on( 'init afterChange', function ( event, slick ) { if ( syncEnable === '' ) { singlePropertyCarousel.find( '.slick-slide' ).removeClass( 'slick-current' ); singlePropertyCarousel.find( '.slick-slide' ).eq( slick.currentSlide ).addClass( "slick-current" ); } } ); singlePropertyCarousel.slick( { slidesToShow : 6, slidesToScroll : 1, asNavFor : singlePropertySlider, // dots: false, infinite : true, centerMode : centerMode, focusOnSelect : true, touchThreshold : 200, arrows : false, centerPadding : '0', rtl : isRtl, responsive : [ { breakpoint : 1200, settings : { slidesToShow : 4 } }, { breakpoint : 767, settings : { slidesToShow : 3 } } ] } ); singlePropertyVerticalCarousel.slick( { slidesToShow : 3, vertical : true, verticalSwiping : true, slidesToScroll : 1, asNavFor : singlePropertySlider, // dots: false, infinite : true, centerMode : centerMode, focusOnSelect : true, touchThreshold : 200, arrows : false, centerPadding : '0', responsive : [ { breakpoint : 1200, settings : { slidesToShow : 3, vertical : false, verticalSwiping : false, rtl : isRtl } } ] } ); singlePropertySlider.slick( { slidesToShow : 1, slidesToScroll : 1, arrows : true, fade : true, adaptiveHeight : true, infinite : true, rtl : isRtl, asNavFor : syncEnable // asNavFor: singlePropertyCarousel, } ); /** * Property Ratings */ if ( jQuery().barrating ) { $( '#rate-it' ).barrating( { theme : 'fontawesome-stars', initialRating : 5 } ); } /** * AJAX Pagination for Listing & Archive Pages */ const propertiesSection = $( '#properties-listing' ); if ( propertiesSection.hasClass( 'ajax-pagination' ) ) { const propertiesContainer = propertiesSection.find( '.rh-ultra-list-box, .rh-ultra-grid-box' ), svgLoader = propertiesSection.find( '.svg-loader' ), paginationContainer = $( '.rh_pagination' ), statsContainer = $( '.rh_pagination__stats' ), mapServiceType = localized.mapService.toString(), page_id = statsContainer.data( 'page-id' ); let cards_container = 'rh-ultra-list-box'; if ( propertiesSection.find( '.rh-ultra-grid-box' ).length ) { cards_container = 'rh-ultra-grid-box'; } $( 'body' ).on( 'click', '.rh-ultra-pagination .rh_pagination > a', function ( e ) { e.preventDefault(); let currentButton = $( this ); svgLoader.slideDown( 'fast' ); propertiesContainer.fadeTo( 'slow', 0.5 ); $( '.rh_pagination > a' ).removeClass( 'current' ); currentButton.addClass( 'current' ); let current_page = parseInt( currentButton.attr( 'data-page-number' ) ); statsContainer.attr( 'data-page', current_page ); paginationContainer.load( currentButton.attr( 'href' ) + ' ' + '.rh_pagination' ); statsContainer.load( currentButton.attr( 'href' ) + ' ' + '.rh_pagination__stats' ); let url = currentButton.attr( 'href' ) + ' ' + '.' + cards_container + ' > *'; propertiesContainer.load( url, function ( response, status, xhr ) { if ( status == 'success' ) { propertiesContainer.fadeTo( 100, 1, function () { } ); svgLoader.slideUp( 'fast' ); $( 'html, body' ).animate( { scrollTop : propertiesSection.find( '.' + cards_container ).offset().top - 120 }, 1000 ); inspirySelectPicker( 'body .inspiry_select_picker_trigger' ); rhUltraTooltip( '.rh-ui-tooltip' ); } else { propertiesContainer.fadeTo( 'slow', 1 ); } if ( typeof realhomesInfoboxPopupTrigger === 'function' ) { realhomesInfoboxPopupTrigger(); } // Binding Favorites & Compare Properties Features if ( typeof realhomes_update_favorites === 'function' ) { realhomes_update_favorites(); } if ( typeof realhomes_update_compare_properties === 'function' ) { realhomes_update_compare_properties(); } } ); // If this pagination is for ajax search results if ( propertiesSection.hasClass( 'realhomes_ajax_search' ) ) { realhomes_update_ajax_map_results( current_page ); let currentQueryStrings = statsContainer.data( 'query-strings' ); let searchURL = $( '.rh_page' ).data( 'search-url' ); if ( current_page === 1 ) { window.history.pushState( {}, '', searchURL + currentQueryStrings ); } else { window.history.pushState( {}, '', searchURL + 'page/' + current_page + '/' + currentQueryStrings ); } } else { $.ajax( { url : ajaxurl, type : 'post', data : { action : 'realhomes_map_ajax_search_results', page_id : page_id, page : current_page }, success : ( response ) => { let propertiesMapData = response.data.propertiesData; if ( typeof realhomes_update_open_street_map !== 'undefined' && typeof mapServiceType !== "undefined" && mapServiceType === 'openstreetmaps' ) { realhomes_update_open_street_map( propertiesMapData ); } else if ( typeof realhomes_update_mapbox !== 'undefined' && typeof mapServiceType !== "undefined" && mapServiceType === 'mapbox' ) { $( '#map-head' ).empty().append( '
' ); realhomes_update_mapbox( propertiesMapData ); } else if ( typeof realhomes_update_google_map !== 'undefined' ) { realhomes_update_google_map( propertiesMapData ); } } } ); window.history.pushState( {}, '', currentButton.attr( 'href' ) ); } window.history.pushState( {}, '', currentButton.attr( 'href' ) ); } ); } /** * Property Floor Plans */ $( '.rh-floor-plan-tab' ).click( function ( e ) { e.preventDefault(); if ( ! $( this ).hasClass( 'rh-current-tab' ) ) { $( '.rh-floor-plan-tab' ).removeClass( 'rh-current-tab' ); $( this ).addClass( 'rh-current-tab' ); $( ".rh-floor-plan" ).removeClass( 'rh-active-tab' ); $( ".rh-floor-plan[data-id='" + $( this ).attr( 'data-id' ) + "']" ).addClass( "rh-active-tab" ); } } ); $( '.rh_wrapper_property_videos_slider' ).slick( { slidesToShow : 1, slidesToScroll : 1, arrows : false, dots : true, fade : true } ); /** * Post Nav Support */ $( function () { var post_nav = $( '.inspiry-post-nav' ); $( window ).on( 'scroll', function () { if ( $( window ).width() > 980 ) { if ( $( this ).scrollTop() > 650 ) { post_nav.fadeIn( 'fast' ).css( "display", "flex" ); return; } } post_nav.fadeOut( 'fast' ); } ); } ); /** * Scroll to Top */ $( function () { const scroll_anchor = $( '#scroll-top' ); $( window ).on( 'scroll', function () { if ( $( this ).scrollTop() > 250 ) { scroll_anchor.addClass( 'show' ); return; } scroll_anchor.removeClass( 'show' ); } ); scroll_anchor.on( 'click', function ( event ) { event.preventDefault(); $( 'html, body' ).animate( { scrollTop : 0 }, 'slow' ); } ); } ); /** * Sidebar Properties Sliders */ var ereSideBarSlider = $( '.ere-ultra-properties-slider' ); ereSideBarSlider.each( function () { var thisContainer = $( this ).next( '.rh-ultra-widget-dots' ); $( this ).owlCarousel( { stagePadding : 0, singleItem : true, loop : false, dots : true, nav : true, items : 1, margin : 10, navText : ['', ''], dotsContainer : thisContainer } ); } ); /** * Properties Sorting */ function insertParam( key, value ) { key = encodeURI( key ); value = encodeURI( value ); var kvp = document.location.search.substr( 1 ).split( '&' ); var i = kvp.length; var x; while ( i-- ) { x = kvp[i].split( '=' ); if ( x[0] == key ) { x[1] = value; kvp[i] = x.join( '=' ); break; } } if ( i < 0 ) { kvp[kvp.length] = [key, value].join( '=' ); } //this will reload the page, it's likely better to store this until finished document.location.search = kvp.join( '&' ); } $( '#sort-properties' ).on( 'change', function () { var key = 'sortby'; var value = $( this ).val(); insertParam( key, value ); } ); /** * Properties Gallery Isotope */ if ( $.isFunction( $.fn.isotope ) ) { const container = $( "#properties-gallery-container" ), filterLinks = $( "#filter-by a" ), isotopeOptions = { filter : "*", layoutMode : 'fitRows', itemSelector : '.isotope-item', animationEngine : 'best-available' }; // RTL support if ( isRtl ) { isotopeOptions.originLeft = false; } // To fix floating bugs due to variation in height setTimeout( function () { container.isotope( isotopeOptions ); }, 1000 ); filterLinks.on( 'click', function ( event ) { let self = $( this ), selector = self.data( 'filter' ); container.isotope( { filter : '.' + selector } ); filterLinks.removeClass( 'active' ); self.addClass( 'active' ); event.preventDefault(); } ); } // footerStick - Run on document ready. footerStick(); function rhDecorateWhatsAppLink() { //set up the url var url = 'https://api.whatsapp.com/send?text='; var thisShareData = $( '.share-this' ); //get property title var name = thisShareData.data( 'property-name' ); //get property permalink var permalink = thisShareData.data( 'property-permalink' ); //encode the text var encodedText = encodeURIComponent( name + ' ' + permalink ); //find the link var whatsApp = $( ".inspiry_whats_app_share_link" ); //set the href attribute on the link whatsApp.attr( 'href', url + encodedText ); } rhDecorateWhatsAppLink(); // Scripts to run on window load and resize events. $window.on( 'load resize', function () { footerStick(); } ); } ); } )( jQuery );; /*! jQuery UI - v1.13.3 - 2024-04-26 * https://jqueryui.com * Includes: widget.js, position.js, data.js, disable-selection.js, effect.js, effects/effect-blind.js, effects/effect-bounce.js, effects/effect-clip.js, effects/effect-drop.js, effects/effect-explode.js, effects/effect-fade.js, effects/effect-fold.js, effects/effect-highlight.js, effects/effect-puff.js, effects/effect-pulsate.js, effects/effect-scale.js, effects/effect-shake.js, effects/effect-size.js, effects/effect-slide.js, effects/effect-transfer.js, focusable.js, form-reset-mixin.js, jquery-patch.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/accordion.js, widgets/autocomplete.js, widgets/button.js, widgets/checkboxradio.js, widgets/controlgroup.js, widgets/datepicker.js, widgets/dialog.js, widgets/draggable.js, widgets/droppable.js, widgets/menu.js, widgets/mouse.js, widgets/progressbar.js, widgets/resizable.js, widgets/selectable.js, widgets/selectmenu.js, widgets/slider.js, widgets/sortable.js, widgets/spinner.js, widgets/tabs.js, widgets/tooltip.js * Copyright jQuery Foundation and other contributors; Licensed MIT */ !function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(x){"use strict";var t,e,i,n,W,C,o,s,r,l,a,h,u;function E(t,e,i){return[parseFloat(t[0])*(a.test(t[0])?e/100:1),parseFloat(t[1])*(a.test(t[1])?i/100:1)]}function L(t,e){return parseInt(x.css(t,e),10)||0}function N(t){return null!=t&&t===t.window}x.ui=x.ui||{},x.ui.version="1.13.3", /*! * jQuery UI :data 1.13.3 * https://jqueryui.com * * Copyright OpenJS Foundation and other contributors * Released under the MIT license. * https://jquery.org/license */ x.extend(x.expr.pseudos,{data:x.expr.createPseudo?x.expr.createPseudo(function(e){return function(t){return!!x.data(t,e)}}):function(t,e,i){return!!x.data(t,i[3])}}), /*! * jQuery UI Disable Selection 1.13.3 * https://jqueryui.com * * Copyright OpenJS Foundation and other contributors * Released under the MIT license. * https://jquery.org/license */ x.fn.extend({disableSelection:(t="onselectstart"in document.createElement("div")?"selectstart":"mousedown",function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}),enableSelection:function(){return this.off(".ui-disableSelection")}}), /*! * jQuery UI Focusable 1.13.3 * https://jqueryui.com * * Copyright OpenJS Foundation and other contributors * Released under the MIT license. * https://jquery.org/license */ x.ui.focusable=function(t,e){var i,n,o,s=t.nodeName.toLowerCase();return"area"===s?(o=(i=t.parentNode).name,!(!t.href||!o||"map"!==i.nodeName.toLowerCase())&&0<(i=x("img[usemap='#"+o+"']")).length&&i.is(":visible")):(/^(input|select|textarea|button|object)$/.test(s)?(n=!t.disabled)&&(o=x(t).closest("fieldset")[0])&&(n=!o.disabled):n="a"===s&&t.href||e,n&&x(t).is(":visible")&&function(t){var e=t.css("visibility");for(;"inherit"===e;)t=t.parent(),e=t.css("visibility");return"visible"===e}(x(t)))},x.extend(x.expr.pseudos,{focusable:function(t){return x.ui.focusable(t,null!=x.attr(t,"tabindex"))}}),x.fn._form=function(){return"string"==typeof this[0].form?this.closest("form"):x(this[0].form)}, /*! * jQuery UI Form Reset Mixin 1.13.3 * https://jqueryui.com * * Copyright OpenJS Foundation and other contributors * Released under the MIT license. * https://jquery.org/license */ x.ui.formResetMixin={_formResetHandler:function(){var e=x(this);setTimeout(function(){var t=e.data("ui-form-reset-instances");x.each(t,function(){this.refresh()})})},_bindFormResetHandler:function(){var t;this.form=this.element._form(),this.form.length&&((t=this.form.data("ui-form-reset-instances")||[]).length||this.form.on("reset.ui-form-reset",this._formResetHandler),t.push(this),this.form.data("ui-form-reset-instances",t))},_unbindFormResetHandler:function(){var t;this.form.length&&((t=this.form.data("ui-form-reset-instances")).splice(x.inArray(this,t),1),t.length?this.form.data("ui-form-reset-instances",t):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset"))}},x.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()), /*! * jQuery UI Support for jQuery core 1.8.x and newer 1.13.3 * https://jqueryui.com * * Copyright OpenJS Foundation and other contributors * Released under the MIT license. * https://jquery.org/license * */ x.expr.pseudos||(x.expr.pseudos=x.expr[":"]),x.uniqueSort||(x.uniqueSort=x.unique),x.escapeSelector||(e=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,i=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},x.escapeSelector=function(t){return(t+"").replace(e,i)}),x.fn.even&&x.fn.odd||x.fn.extend({even:function(){return this.filter(function(t){return t%2==0})},odd:function(){return this.filter(function(t){return t%2==1})}}), /*! * jQuery UI Keycode 1.13.3 * https://jqueryui.com * * Copyright OpenJS Foundation and other contributors * Released under the MIT license. * https://jquery.org/license */ x.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}, /*! * jQuery UI Labels 1.13.3 * https://jqueryui.com * * Copyright OpenJS Foundation and other contributors * Released under the MIT license. * https://jquery.org/license */ x.fn.labels=function(){var t,e,i;return this.length?this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(e=this.eq(0).parents("label"),(t=this.attr("id"))&&(i=(i=this.eq(0).parents().last()).add((i.length?i:this).siblings()),t="label[for='"+x.escapeSelector(t)+"']",e=e.add(i.find(t).addBack(t))),this.pushStack(e)):this.pushStack([])},x.ui.plugin={add:function(t,e,i){var n,o=x.ui[t].prototype;for(n in i)o.plugins[n]=o.plugins[n]||[],o.plugins[n].push([e,i[n]])},call:function(t,e,i,n){var o,s=t.plugins[e];if(s&&(n||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(o=0;o