WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] [PATCH] Update map on location name change; update only when address&town given (3 posts)

  1. Daedalon
    Member
    Posted 1 year ago #

    Two bugfixes for 5.2.9:

    1. If you're adding a new event and have already written an address for its location, you see the map with an info balloon stating the name and address of the location. If you change anything about the address, the map and the balloon are updated, but if you change the location's name, this is not reflected in the balloon. The fix is to locate in includes/js/events-manager.js the line 831:

    jQuery('#location-town, #location-address, #location-state, #location-postcode, #location-country').change( function(){

    and replace it with

    jQuery('#location-name, #location-town, #location-address, #location-state, #location-postcode, #location-country').change( function(){

    2. Changing any part of the address (and after the above fix, the name) of the location updates the map. This produces unwanted behavior when all the address textfields are empty. To hide the map in these cases instead of showing a location in the middle of nowhere, insert these lines after the above line 831:

    if( jQuery('#location-town, #location-address, #location-state, #location-postcode').length == 0 ){
    				jQuery('#em-map').hide();
    				jQuery('#em-map-404').show();
    				return false;
    			}

    EDIT: Simplified the condition statement in the if.

    http://wordpress.org/extend/plugins/events-manager/

  2. Daedalon
    Member
    Posted 1 year ago #

    Could this be pulled into core?

    In short, the two fixes above are done by replacing in includes/js/events-manager.js line 831:

    jQuery('#location-town, #location-address, #location-state, #location-postcode, #location-country').change( function(){

    with

    jQuery('#location-name, #location-town, #location-address, #location-state, #location-postcode, #location-country').change( function(){
    			if( jQuery('#location-town, #location-address, #location-state, #location-postcode').length == 0 ){
    				jQuery('#em-map').hide();
    				jQuery('#em-map-404').show();
    				return false;
    			}

    Implementing this in a custom JS file would include copying silly amounts of EM JS.

  3. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

    will look at this and add in 5.3.2

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.