Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #702800

    Hello,

    When pressing the “Click here to enter an address.” button I get the following error in my javascript console:
    ReferenceError: event is not defined: event.preventDefault();

    Located in:

    themes/enfold/framework/js/conditional_load/avia_google_maps_widget.js?ver=1.0.0

    Line 39

    The expected action does not happen (pop up to enter the address doesn’t show, nothing happens)

    The error comes from these lines:

    $(".avia-coordinates-help-link").on('click', function() {
                event.preventDefault();
    
                avia_google_maps_widget_container = jQuery(this).parents('.widget-content');
                avia_google_maps_widget_container.find(".avia-coordinates-help-link").hide();
                avia_google_maps_widget_container.find(".avia-coordinates-wrapper").hide();
                avia_google_maps_widget_container.find(".avia-find-coordinates-wrapper").show();
            });
    
            $(".avia-populate-coordinates").click(function() {
                event.preventDefault();
    
                avia_google_maps_widget_container = jQuery(this).parents('.widget-content');
                var streetAddress = avia_google_maps_widget_container.find(".avia-map-street-address").val(),
                    city = avia_google_maps_widget_container.find(".avia-map-city").val(),
                    state = avia_google_maps_widget_container.find(".avia-map-state").val(),
                    postcode = avia_google_maps_widget_container.find(".avia-map-postcode").val(),
                    country = avia_google_maps_widget_container.find(".avia-map-country").val();
    
                avia_google_maps_widget_container.find(".avia-loading-coordinates").show();
    
                var addressGeo = streetAddress + " " + city + " " + state + " " + postcode + " " + country;
                avia_fetch_coordinates(addressGeo);
            });

    As far as I can see, it can be fixed by using event as parameter in the anonymous functions like so:

    $(".avia-coordinates-help-link").on('click', function(event) {
                event.preventDefault();
    
                avia_google_maps_widget_container = jQuery(this).parents('.widget-content');
                avia_google_maps_widget_container.find(".avia-coordinates-help-link").hide();
                avia_google_maps_widget_container.find(".avia-coordinates-wrapper").hide();
                avia_google_maps_widget_container.find(".avia-find-coordinates-wrapper").show();
            });
    
            $(".avia-populate-coordinates"ck(function(event) {
                event.preventDefault();
    
                avia_google_maps_widget_container = jQuery(this).parents('.widget-content');
                var streetAddress = avia_google_maps_widget_container.find(".avia-map-street-address").val(),
                    city = avia_google_maps_widget_container.find(".avia-map-city").val(),
                    state = avia_google_maps_widget_container.find(".avia-map-state").val(),
                    postcode = avia_google_maps_widget_container.find(".avia-map-postcode").val(),
                    country = avia_google_maps_widget_container.find(".avia-map-country").val();
    
                avia_google_maps_widget_container.find(".avia-loading-coordinates").show();
    
                var addressGeo = streetAddress + " " + city + " " + state + " " + postcode + " " + country;
                avia_fetch_coordinates(addressGeo);
            });
    #703205

    Any update on this?

    #703603

    Hi,

    Thank you for using Enfold.

    Is this happening in the advance layout builder? We need the login details to check the issue. Please post it in the private content field. Did you add the google map api key? http://kriesi.at/documentation/enfold/how-to-register-a-google-maps-api-key/

    Best regards,
    Ismael

    #703690

    I have the Enfold construction setup
    It’s happening in the widget Enfold Child Google Maps Widget: Route that’s by default placed in the Sidebar Pages.

    Page where the error occurs: http://scode.nl/edsklussenbedrijf/wp-admin/widgets.php
    Widget: Enfold Child Google Maps Widget: Route

    #705229

    Sorry to bump again, but is there an update?

    #705236

    Hi,

    I’m sorry but I can’t see the error in the widgets panel. However, the following notification is in the console.

    util.js:221 Google Maps API warning: InvalidKey https://developers.google.com/maps/documentation/javascript/error-messages#invalid-key

    Please review the google maps api key documention. It’s possible that the API key that you entered in the Enfold > Google Services panel is incorrect. http://kriesi.at/documentation/enfold/how-to-register-a-google-maps-api-key

    Best regards,
    Ismael

    #705238

    I had a Google Maps warning, and I updated the api key. The google maps warning is now gone.
    However, this did not fix the problem. I still cannot change the address in the widget.
    See the attached image:
    Google Maps widget error

    #705241

    I’m quite certain the code change suggestion in my initial post would fix this problem. The JS error says event is not defined, and this is indeed the case. adding the event parameter to the anonymous functions would fix this.

    Error is presenting on Firefox 49.0.2

    #706618

    Hi,

    I checked for the issue and was able to enter the address without any issues. There are no js errors in console showing on my end in windows chrome and firefox (screenshot attached).

    For testing purpose just enter the state and country and fetch co-ordinates and save the changes. This should work for you as well. Then you can add just the street address.

    Before trying the above steps please try to hard refresh by pressing Ctrl + Shift + F5 on your browser or press the F12 key to open chrome dev tools and right click on the refresh button and select “Empty Cache and Hard Reload” and review the site again.

    Best regards,
    Vinay

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.