Set onFocusOnly: true when initializing maps, so that the user must click on the map before scroll zoom works.

This commit is contained in:
Michael Stenta 2019-12-05 16:43:15 -05:00
parent cc5664473c
commit c8c89d195e
1 changed files with 3 additions and 1 deletions

View File

@ -2,10 +2,12 @@
Drupal.behaviors.farm_map = {
attach: function (context, settings) {
var units = Drupal.settings.farm_map.units;
var interactions = { onFocusOnly: true };
if (settings.farm_map.maps) {
settings.farm_map.maps.forEach(function (target) {
$('#' + target, context).once('farm-map', function () {
farmOS.map.create(target, { units: units });
$('#' + target, context).attr('tabIndex', 0);
farmOS.map.create(target, { units: units, interactions: interactions });
});
});
}