Skip to content

Commit 934efb6

Browse files
committed
CustomEvent is widely available for many years
1 parent 7e909b0 commit 934efb6

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

leaflet/static/leaflet/leaflet.extras.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -254,15 +254,8 @@ L.Map.djangoMap = function (id, options) {
254254

255255

256256
function triggerEvent(target, type, data) {
257-
if (typeof window.CustomEvent == 'function') {
258-
var evt = new CustomEvent(type, {detail: data});
259-
target.dispatchEvent(evt);
260-
}
261-
else if (window.jQuery) {
262-
var evt = jQuery.Event(type);
263-
evt.detail = data;
264-
jQuery(target).trigger(evt);
265-
}
257+
const evt = new CustomEvent(type, {detail: data});
258+
target.dispatchEvent(evt);
266259
}
267260
};
268261

0 commit comments

Comments
 (0)