diff --git a/js/src/config.js b/js/src/config.js index e65d925b79..f42551ada6 100644 --- a/js/src/config.js +++ b/js/src/config.js @@ -2,8 +2,6 @@ * Functions used in configuration forms and on user preferences pages */ -/* exported PASSIVE_EVENT_LISTENERS */ - var configInlineParams; var configScriptLoaded; @@ -841,23 +839,3 @@ function offerPrefsAutoimport () { }); $cnt.show(); } - -/** - * @type {boolean} Support for passive event listener option - */ -var PASSIVE_EVENT_LISTENERS = (function () { - var passive = false; - try { - var options = Object.defineProperty({}, 'passive', { - get: function () { - return (passive = true); - }, - }); - - window.addEventListener('_', null, options); - window.removeEventListener('_', null, options); - } catch (error) { - // passive not supported - } - return passive; -}()); diff --git a/js/src/table/gis_visualization.js b/js/src/table/gis_visualization.js index b89c1d70f3..4ed50b8db2 100644 --- a/js/src/table/gis_visualization.js +++ b/js/src/table/gis_visualization.js @@ -6,7 +6,7 @@ * @requires vendor/jquery/jquery.mousewheel.js */ -/* global drawOpenLayers PASSIVE_EVENT_LISTENERS */ // templates/table/gis_visualization/gis_visualization.twig +/* global drawOpenLayers */ // templates/table/gis_visualization/gis_visualization.twig // Constants var zoomFactor = 1.5; @@ -195,11 +195,7 @@ AJAX.registerTeardown('table/gis_visualization.js', function () { $(document).off('click', '#up_arrow'); $(document).off('click', '#down_arrow'); $('.vector').off('mousemove').off('mouseout'); - $('#placeholder').get(0).removeEventListener( - 'wheel', - onGisMouseWheel, - PASSIVE_EVENT_LISTENERS ? { passive: false } : undefined - ); + $('#placeholder').get(0).removeEventListener('wheel', onGisMouseWheel, { passive: false }); if (map) { // Removes ol.Map's resize listener from window map.setTarget(null); @@ -230,11 +226,7 @@ AJAX.registerOnload('table/gis_visualization.js', function () { } }); - $('#placeholder').get(0).addEventListener( - 'wheel', - onGisMouseWheel, - PASSIVE_EVENT_LISTENERS ? { passive: false } : undefined - ); + $('#placeholder').get(0).addEventListener('wheel', onGisMouseWheel, { passive: false }); var dragX = 0; var dragY = 0;