FieldtypeMapMarker icon indicating copy to clipboard operation
FieldtypeMapMarker copied to clipboard

Inputfield map does not initialise when AJAX-loaded

Open Toutouwai opened this issue 8 years ago • 2 comments

If the Map Marker inputfield is AJAX-loaded (e.g. in a repeater, or because field visibility setting) then the map does not initialise.

Suggested fix

Add to InputfieldMapMarker.js:

$(document).on('reloaded', '.InputfieldMapMarker', function() {
    $(this).find('.InputfieldMapMarkerMap').each(function() {
        var $t = $(this);
        InputfieldMapMarker.init($t.attr('id'), $t.attr('data-lat'), $t.attr('data-lng'), $t.attr('data-zoom'), $t.attr('data-type'));
    });
});

Toutouwai avatar Jun 14 '17 21:06 Toutouwai

Good work. A tested fix @ryancramerdesign

cb2004 avatar Jul 17 '17 21:07 cb2004

Actually this doesnt seem to work in fieldset tab.

cb2004 avatar Jul 17 '17 21:07 cb2004