Skip to content

Commit

Permalink
Remove Edge from browser detection (Leaflet#8606)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonkoops authored Oct 20, 2022
1 parent 0310376 commit 43d4984
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/examples/choropleth/example.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ css: "#map {
fillOpacity: 0.7
});

if (!L.Browser.opera && !L.Browser.edge) {
if (!L.Browser.opera) {
layer.bringToFront();
}

Expand Down
4 changes: 2 additions & 2 deletions docs/examples/choropleth/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ Now let's make the states highlighted visually in some way when they are hovered
fillOpacity: 0.7
});

if (!L.Browser.opera && !L.Browser.edge) {
if (!L.Browser.opera) {
layer.bringToFront();
}
}

Here we get access to the layer that was hovered through `e.target`, set a thick grey border on the layer as our highlight effect, also bringing it to the front so that the border doesn't clash with nearby states (but not for IE, Opera or Edge, since they have problems doing `bringToFront` on `mouseover`).
Here we get access to the layer that was hovered through `e.target`, set a thick grey border on the layer as our highlight effect, also bringing it to the front so that the border doesn't clash with nearby states.

Next we'll define what happens on `mouseout`:

Expand Down
6 changes: 1 addition & 5 deletions src/core/Browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ import {svgCreate} from '../layer/vector/SVG.Util';

var style = document.documentElement.style;

// @property edge: Boolean; `true` for the Edge web browser.
var edge = 'msLaunchUri' in navigator && !('documentMode' in document);

// @property webkit: Boolean;
// `true` for webkit-based browsers like Chrome and Safari (including mobile versions).
var webkit = userAgentContains('webkit');
Expand All @@ -29,7 +26,7 @@ var webkit = userAgentContains('webkit');
var opera = !!window.opera;

// @property chrome: Boolean; `true` for the Chrome browser.
var chrome = !edge && userAgentContains('chrome');
var chrome = userAgentContains('chrome');

// @property gecko: Boolean; `true` for gecko-based browsers like Firefox.
var gecko = userAgentContains('gecko') && !webkit && !opera;
Expand Down Expand Up @@ -139,7 +136,6 @@ function userAgentContains(str) {


export default {
edge,
webkit,
opera,
chrome,
Expand Down
3 changes: 1 addition & 2 deletions src/dom/DomEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,7 @@ export function getWheelPxFactor() {
// Events from pointing devices without precise scrolling are mapped to
// a best guess of 60 pixels.
export function getWheelDelta(e) {
return (Browser.edge) ? e.wheelDeltaY / 2 : // Don't trust window-geometry-based delta
(e.deltaY && e.deltaMode === 0) ? -e.deltaY / getWheelPxFactor() : // Pixels
return (e.deltaY && e.deltaMode === 0) ? -e.deltaY / getWheelPxFactor() : // Pixels
(e.deltaY && e.deltaMode === 1) ? -e.deltaY * 20 : // Lines
(e.deltaY && e.deltaMode === 2) ? -e.deltaY * 60 : // Pages
(e.deltaX || e.deltaZ) ? 0 : // Skip horizontal/depth wheel events
Expand Down

0 comments on commit 43d4984

Please sign in to comment.