// SVG icon. function imgSvg() { jQuery( '.imgsvg' ).each( function() { var $img = jQuery( this ); var imgID = $img.attr( 'id' ); var imgClass = $img.attr( 'class' ); var imgURL = $img.attr( 'src' ); jQuery.get( imgURL, function( data ) { var $svg = jQuery(data).find( 'svg' ); if ( typeof imgID !== 'undefined' ) { $svg = $svg.attr( 'id', imgID ); } if ( typeof imgClass !== 'undefined' ) { $svg = $svg.attr( 'class', imgClass + ' replaced-svg' ); } $svg = $svg.removeAttr( 'xmlns:a' ); if ( ! $svg.attr( 'viewBox' ) && $svg.attr( 'height' ) && $svg.attr( 'width' ) ) { $svg.attr( 'viewBox', '0 0 ' + $svg.attr( 'height' ) + ' ' + $svg.attr( 'width' ) ) } $img.replaceWith( $svg ); }, 'xml' ); } ); } // Search show and hide. function ammSearch() { jQuery( '.amm-search-action a' ).click( function() { jQuery( '.amm-map-search-bar' ).fadeIn(); } ); jQuery( '.search-close' ).click( function() { jQuery( '.amm-map-search-bar' ).fadeOut(); jQuery( '#amm_search_area' ).val(''); } ); jQuery( '.sidebar-action' ).click( function() { jQuery( '.amm-map-header' ).toggleClass( 'full' ); jQuery( '.amm-map-content' ).toggleClass( 'full' ); jQuery( '.amm-map-sidebar' ).toggleClass( 'off' ); } ); } // Map structure when responsiveness. function mapStructure(){ var ww = jQuery( window ).width(); if ( ww < 1500 ) { jQuery( '.amm-map-header' ).addClass( 'full' ); jQuery( '.amm-map-content' ).addClass( 'full' ); jQuery( '.amm-map-sidebar' ).addClass( 'off' ); } else { jQuery( '.amm-map-header' ).removeClass( 'full' ); jQuery( '.amm-map-content' ).removeClass( 'full' ); jQuery( '.amm-map-sidebar' ).removeClass( 'off' ); } } jQuery( window ).on( 'load resize', function() { mapStructure(); });