1( function( $ ) { 2 3 "use strict"; 4 5 const initGeolocationFilter = function() { 6 7 window.JetSmartFilters.filtersList.JetEngineUserGeolocation = 'jet-smart-filters-user-geolocation'; 8 window.JetSmartFilters.filters.JetEngineUserGeolocation = class JetEngineUserGeolocation extends window.JetSmartFilters.filters.Search { 9 10 name = 'user-geolocation'; 11 12 constructor( $container ) { 13 14 const $filter = $container.find( '.geolocation-data' ); 15 16 super( $container, $filter ); 17 18 if ( navigator.geolocation ) { 19 20 navigator.geolocation.getCurrentPosition( ( position ) => { 21 22 this.dataValue = { 23 latitude: position.coords.latitude, 24 longitude: position.coords.longitude, 25 } 26 27 this.emitFitersApply(); 28 29 } ); 30 } 31 32 } 33 34 processData() { 35 } 36 37 }; 38 39 } 40 41 if ( window.JetMapListingGeolocationFilterData && 'jet-smart-filters/before-init' === window.JetMapListingGeolocationFilterData.initEvent ) { 42 document.addEventListener( 'jet-smart-filters/before-init', ( e ) => { 43 initGeolocationFilter(); 44 }); 45 } else { 46 window.addEventListener( 'DOMContentLoaded', ( e ) => { 47 initGeolocationFilter(); 48 }); 49 } 50 51}( jQuery ) );
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.