Destroy farmOS-map instances when Drupal behaviors are detached.

This commit is contained in:
Michael Stenta 2020-02-02 14:44:11 -05:00
parent 18e86f9550
commit c3ca0cc041
1 changed files with 5 additions and 0 deletions

View File

@ -13,6 +13,11 @@
farmOS.map.create($(element).attr('id'), options);
});
});
},
detach: function (context, settings) {
$('.farm-map', context).each(function (index, element) {
farmOS.map.destroy($(element).attr('id'));
});
}
};
}(jQuery));