{"action":"created","issue":{"url":"https://api.github.com/repos/FacetWP/facetwp-map-template/issues/3","repository_url":"https://api.github.com/repos/FacetWP/facetwp-map-template","labels_url":"https://api.github.com/repos/FacetWP/facetwp-map-template/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/FacetWP/facetwp-map-template/issues/3/comments","events_url":"https://api.github.com/repos/FacetWP/facetwp-map-template/issues/3/events","html_url":"https://github.com/FacetWP/facetwp-map-template/issues/3","id":166207420,"number":3,"title":"Working, but how to call your existing jQuery function?","user":{"login":"peternoges","id":7834562,"avatar_url":"https://avatars.githubusercontent.com/u/7834562?v=3","gravatar_id":"","url":"https://api.github.com/users/peternoges","html_url":"https://github.com/peternoges","followers_url":"https://api.github.com/users/peternoges/followers","following_url":"https://api.github.com/users/peternoges/following{/other_user}","gists_url":"https://api.github.com/users/peternoges/gists{/gist_id}","starred_url":"https://api.github.com/users/peternoges/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peternoges/subscriptions","organizations_url":"https://api.github.com/users/peternoges/orgs","repos_url":"https://api.github.com/users/peternoges/repos","events_url":"https://api.github.com/users/peternoges/events{/privacy}","received_events_url":"https://api.github.com/users/peternoges/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-18T22:21:52Z","updated_at":"2016-10-25T14:55:33Z","closed_at":null,"body":"Hi Matt, I have this working.  However, I want the locate-me button to be clicked upon load of my page. I noticed that in your front-facets.js file you have a click handler for this button as so:     \r\n\r\n`$(document).on('click', '.facetwp-type-proximity .locate-me', function(e) {\r\n`...\r\n\r\nHowever when I add the same code (changing the trigger from your front-facets.js file, and i've modified the trigger from `    $(document).on('click', '.facetwp-type-proximity .locate-me', function(e) {\r\n` to `jQuery(document).ready(function(e) {` there are no js errors in my console but after page load the site does not run the code. Here is my attempt at having the button logic fire after page load:  \r\n\r\n```\r\n<script type=\"text/javascript\">\r\njQuery(document).ready(function(e) {\r\n        var $this = e(this);\r\n        var $input = e('#facetwp-location');\r\n        var $facet = $input.closest('.facetwp-facet');\r\n        var $lat = e('.facetwp-lat');\r\n        var $lng = e('.facetwp-lng');\r\n\r\n        // Reset\r\n        if ($this.hasClass('f-reset')) {\r\n            $facet.find('.facetwp-lat').val('');\r\n            $facet.find('.facetwp-lng').val('');\r\n            $facet.find('#facetwp-location').val('');\r\n            FWP.autoload();\r\n            return;\r\n        }\r\n\r\n        // loading icon\r\n        e('.locate-me').addClass('f-loading');\r\n\r\n        // HTML5 geolocation\r\n        navigator.geolocation.getCurrentPosition(function(position) {\r\n            var lat = position.coords.latitude;\r\n            var lng = position.coords.longitude;\r\n\r\n            $lat.val(lat);\r\n            $lng.val(lng);\r\n\r\n            var geocoder = new google.maps.Geocoder();\r\n            var latlng = {lat: parseFloat(lat), lng: parseFloat(lng)};\r\n            geocoder.geocode({'location': latlng}, function(results, status) {\r\n                if (status === google.maps.GeocoderStatus.OK) {\r\n                    $input.val(results[0].formatted_address);\r\n                }\r\n                else {\r\n                    $input.val('Your location');\r\n                }\r\n                e('.locate-me').addClass('f-reset');\r\n                FWP.autoload();\r\n            });\r\n\r\n            e('.locate-me').removeClass('f-loading');\r\n        },\r\n        function() {\r\n            e('.locate-me').removeClass('f-loading');\r\n        });\r\n    });\r\n</script>\r\n```\r\n\r\nCan you help ensure that load of my individual page calls your function as if someone clicked on the locate-me icon? \r\n\r\nThank you,"},"comment":{"url":"https://api.github.com/repos/FacetWP/facetwp-map-template/issues/comments/256059032","html_url":"https://github.com/FacetWP/facetwp-map-template/issues/3#issuecomment-256059032","issue_url":"https://api.github.com/repos/FacetWP/facetwp-map-template/issues/3","id":256059032,"user":{"login":"robwent","id":411678,"avatar_url":"https://avatars.githubusercontent.com/u/411678?v=3","gravatar_id":"","url":"https://api.github.com/users/robwent","html_url":"https://github.com/robwent","followers_url":"https://api.github.com/users/robwent/followers","following_url":"https://api.github.com/users/robwent/following{/other_user}","gists_url":"https://api.github.com/users/robwent/gists{/gist_id}","starred_url":"https://api.github.com/users/robwent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robwent/subscriptions","organizations_url":"https://api.github.com/users/robwent/orgs","repos_url":"https://api.github.com/users/robwent/repos","events_url":"https://api.github.com/users/robwent/events{/privacy}","received_events_url":"https://api.github.com/users/robwent/received_events","type":"User","site_admin":false},"created_at":"2016-10-25T14:55:33Z","updated_at":"2016-10-25T14:55:33Z","body":"    jQuery(window).load(function(){\r\n        jQuery('.facetwp-type-proximity .locate-me').click();\r\n    });\r\n\r\n?"}}
{"actor":{"display_login":"robwent"}}