Problem/Motivation

The ajax call is fired when the marker is clicked. When programmatically clicking a marker to open the popup, it opened the popup but the AJAX was never fired. What I got was the popup opening with a loader spinning. jQuery(marker).click();

Proposed resolutions

Three possible solutions:

  • (Didn't work for some reason) Simply remove the check if the popup is open before calling AJAX: if (this._popup._isOpen)Deferring to maintainer on the legitimacy of this.
  • (Recommended)If checking that the popup is open is necessary, then add code to open the popup before checking if it's open during the click event in leaflet_views_ajax_popup.js:
          // Open the popup if it's not already opened
          if (!this._popup.isOpen) {
            this.openPopup();
          }
  • Without modifying the module, you can fix this by opening the popup before clicking it: marker.openPopup(); jQuery(marker).click();
CommentFileSizeAuthor
#1 open_popup_before_click-2478175-1.patch694 bytespuddyglum

Comments

puddyglum’s picture

Status: Active » Needs review
StatusFileSize
new694 bytes

Patch for recommended solution, opens popup if it's not open.

alex.bukach’s picture

In fact, checking that the popup is open is not necessary now, after we made it not to load content from server more than once for each marker.

  • Alex Bukach committed e4aaeb4 on 7.x-1.x authored by jmonkfish
    Issue #2478175 by jmonkfish, Alex Bukach: Programmatically clicking...
alex.bukach’s picture

Status: Needs review » Fixed

  • Alex Bukach committed df357ec on 8.x-1.x authored by jmonkfish
    Issue #2478175 by jmonkfish, Alex Bukach: Programmatically clicking...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.