diff --git a/src/components/BrowserSnifferService.js b/src/components/BrowserSnifferService.js index a87d28429a..0693aba762 100644 --- a/src/components/BrowserSnifferService.js +++ b/src/components/BrowserSnifferService.js @@ -58,7 +58,8 @@ move: 'mousemove', end: 'mouseup', over: 'mouseover', - out: 'mouseout' + out: 'mouseout', + menu: 'contextmenu' }, touch: { start: 'touchstart', @@ -70,23 +71,19 @@ move: 'MSPointerMove', end: 'MSPointerUp', over: 'MSPointerOver', - out: 'MSPointerOut' + out: 'MSPointerOut', + menu: 'contextmenu' }, pointer: { start: 'pointerdown', move: 'pointermove', end: 'pointerup', over: 'pointerover', - out: 'pointerout' + out: 'pointerout', + menu: 'contextmenu' } }; - if ($window.oncontextmenu) { - events.mouse.menu = 'contextmenu'; - events.msPointer.menu = 'contextmenu'; - events.pointer.menu = 'contextmenu'; - } - var eventsKeys = events.mouse; if (usePointerEvents) { eventsKeys = events.pointer; diff --git a/src/components/contextpopup/ContextPopupDirective.js b/src/components/contextpopup/ContextPopupDirective.js index d8a6d3a473..89abe6e760 100644 --- a/src/components/contextpopup/ContextPopupDirective.js +++ b/src/components/contextpopup/ContextPopupDirective.js @@ -62,9 +62,9 @@ event.stopPropagation(); event.preventDefault(); - //On Max, left-click with ctrlKey also fires + //On Mac, left-click with ctrlKey also fires //the 'contextmenu' event. But this conflicts - //with selectByRectangl feature (in featuretree + //with selectByRectangle feature (in featuretree //directive). So we bail out here if //ctrlKey is pressed if (event.ctrlKey) { @@ -155,10 +155,7 @@ }; - if (gaBrowserSniffer.events.menu) { - // On surface tablet a 'contextmenu' event is triggered - // on long press. - // Listen to contextmenu events from the viewport. + if (!gaBrowserSniffer.mobile && gaBrowserSniffer.events.menu) { $(map.getViewport()).on(gaBrowserSniffer.events.menu, handler); element.on(gaBrowserSniffer.events.menu, 'a', function(e) { e.stopPropagation();