Skip to content
Snippets Groups Projects
Commit 90d209bd authored by Italo Mairo's avatar Italo Mairo
Browse files

Fix to load Ajax Popup only once

parent 24e4c4da
No related branches found
Tags 10.0.12
No related merge requests found
......@@ -92,14 +92,14 @@
// On leaflet-ajax-popup selector, fetch and set Ajax content.
let element = e.popup._contentNode;
let content = $('[data-leaflet-ajax-popup]', element);
let content = $('*[data-leaflet-ajax-popup]', element);
if (content.length) {
let url = content.data('leaflet-ajax-popup');
Drupal.ajax({url: url}).execute().done(function () {
Drupal.ajax({url: url}).execute().done(function (data) {
// Copy the html we received via AJAX to the popup, so we won't
// have to make another AJAX call (#see 3258780).
e.popup.setContent(element.innerHTML);
e.popup.setContent(data[0].data);
// Attach drupal behaviors on new content.
Drupal.attachBehaviors(element, drupalSettings);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment