WordPress.org

Support

Support » Plugins and Hacks » Events Manager » [Resolved] [PATCH] Update map on location name change; update only when address&town given

[Resolved] [PATCH] Update map on location name change; update only when address&town given

  • Daedalon

    @daedalon

    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/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Daedalon

    @daedalon

    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.

    Plugin Author Marcus

    @netweblogic

    will look at this and add in 5.3.2

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] [PATCH] Update map on location name change; update only when address&town given’ is closed to new replies.
Skip to toolbar