• Resolved mjloeff

    (@mjloeff)


    Not sure if this has been addressed elsewhere, but the code for location search in post editor doesn’t work in all browsers. i.e. Enter a location in the search field, hit enter, and nothing happens. I’ve made the following change which has fixed my problem, but of course it needs to be updated when Geo Mashup gets updated.

    In location-editor.js:

    Changed this:

    $('#geo_mashup_search')
     .focus( function() {
        var $container = $( '#geo_mashup_map' );
        this.select();
        map.resizeTo( $container.width(), $container.height() );
      } )
        .keypress( function(e) {
          return searchKey( e, this.value );
        } );

    To this:

    $('#geo_mashup_search')
     .focus( function() {
        var $container = $( '#geo_mashup_map' );
        this.select();
        map.resizeTo( $container.width(), $container.height() );
      } )
      .keyup( function(e) {  /* MJL  .keypress isn't always functional, use .keyup too */
          e.preventDefault();
          return searchKey( e, this.value );
        })
        .keypress( function(e) {
          return searchKey( e, this.value );
        } );

    https://wordpress.org/plugins/geo-mashup/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Dylan Kuhn

    (@cyberhobo)

    Which browser is failing for you?

    Your code seems to work on Chrome, but I’m curious if some browsers would fire both events and run searches twice.

    Thread Starter mjloeff

    (@mjloeff)

    The original code was working in Firefox (without the .keyup handler), but it doesn’t work at all for me in what I’ve tested so far. Only with .keyup in there does it work.

    Not working on:
    Chrome 39.0.2171.96 on Linux (Kubuntu 12.04 in my case), 64 bit.
    Chrome 39.0.2171.99m on Windows 8.1, 64 bit.
    IE 11.0.9600.17501 on Windows 7, 64 bit.
    IE 11.0.9600.17501 on Windows 8.1, 64 bit.

    Plugin Author Dylan Kuhn

    (@cyberhobo)

    Thanks for the info! I included keyup in the 1.8.3 release.

    Thread Starter mjloeff

    (@mjloeff)

    Great – thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Location Search not always working’ is closed to new replies.