Comparing version 1.9.2 to 1.9.3
{ | ||
"name": "leaflet", | ||
"version": "1.9.2", | ||
"version": "1.9.3", | ||
"homepage": "https://leafletjs.com/", | ||
@@ -45,3 +45,3 @@ "description": "JavaScript library for mobile-friendly interactive maps", | ||
"scripts": { | ||
"docs": "node ./build/docs.js", | ||
"docs": "node ./build/docs.js && node ./build/integrity.js", | ||
"test": "karma start ./spec/karma.conf.js", | ||
@@ -54,3 +54,2 @@ "build": "npm run rollup && npm run uglify", | ||
"uglify": "uglifyjs dist/leaflet-src.js -c -m -o dist/leaflet.js --source-map filename=dist/leaflet.js.map --source-map content=dist/leaflet-src.js.map --source-map url=leaflet.js.map --comments", | ||
"integrity": "NODE_ENV=release npm run build && node ./build/integrity.js", | ||
"bundlemon": "bundlemon --subProject js --defaultCompression none && bundlemon --subProject js-gzip --defaultCompression gzip", | ||
@@ -70,8 +69,6 @@ "serve": "cd docs && bundle exec jekyll serve", | ||
"docs/_posts/2012*", | ||
"docs/_site" | ||
"docs/_site", | ||
"build/integrity.js" | ||
], | ||
"root": true, | ||
"globals": { | ||
"L": true | ||
}, | ||
"env": { | ||
@@ -78,0 +75,0 @@ "commonjs": true, |
@@ -190,9 +190,3 @@ | ||
DomEvent.on(container, { | ||
mouseenter: function () { | ||
DomEvent.on(section, 'click', DomEvent.preventDefault); | ||
this.expand(); | ||
setTimeout(function () { | ||
DomEvent.off(section, 'click', DomEvent.preventDefault); | ||
}); | ||
}, | ||
mouseenter: this._expandSafely, | ||
mouseleave: this.collapse | ||
@@ -207,4 +201,14 @@ }, this); | ||
DomEvent.on(link, 'click', DomEvent.preventDefault); // prevent link function | ||
DomEvent.on(link, 'focus', this.expand, this); | ||
DomEvent.on(link, { | ||
keydown: function (e) { | ||
if (e.keyCode === 13) { | ||
this._expandSafely(); | ||
} | ||
}, | ||
// Certain screen readers intercept the key event and instead send a click event | ||
click: function (e) { | ||
DomEvent.preventDefault(e); | ||
this._expandSafely(); | ||
} | ||
}, this); | ||
@@ -414,2 +418,11 @@ if (!collapsed) { | ||
return this; | ||
}, | ||
_expandSafely: function () { | ||
var section = this._section; | ||
DomEvent.on(section, 'click', DomEvent.preventDefault); | ||
this.expand(); | ||
setTimeout(function () { | ||
DomEvent.off(section, 'click', DomEvent.preventDefault); | ||
}); | ||
} | ||
@@ -416,0 +429,0 @@ |
@@ -123,2 +123,3 @@ import * as Util from './Util'; | ||
function checkDeprecatedMixinEvents(includes) { | ||
/* global L: true */ | ||
if (typeof L === 'undefined' || !L || !L.Mixin) { return; } | ||
@@ -125,0 +126,0 @@ |
import * as DomEvent from './DomEvent'; | ||
import Browser from '../core/Browser'; | ||
import {falseFn} from '../core/Util'; | ||
@@ -36,3 +37,3 @@ /* | ||
console.warn('wrong event specified:', type); | ||
return L.Util.falseFn; | ||
return falseFn; | ||
} | ||
@@ -39,0 +40,0 @@ handler = handle[type].bind(this, handler); |
@@ -5,3 +5,3 @@ import {Map} from '../map/Map'; | ||
import * as Util from '../core/Util'; | ||
import {toLatLng} from '../geo/LatLng'; | ||
import {toLatLng, LatLng} from '../geo/LatLng'; | ||
import {toPoint} from '../geometry/Point'; | ||
@@ -46,3 +46,3 @@ import * as DomUtil from '../dom/DomUtil'; | ||
initialize: function (options, source) { | ||
if (options && (options instanceof L.LatLng || Util.isArray(options))) { | ||
if (options && (options instanceof LatLng || Util.isArray(options))) { | ||
this._latlng = toLatLng(options); | ||
@@ -49,0 +49,0 @@ Util.setOptions(this, source); |
@@ -292,3 +292,3 @@ import {LayerGroup} from './LayerGroup'; | ||
if (!levelsDeep && closed) { | ||
coords.push(coords[0]); | ||
coords.push(coords[0].slice()); | ||
} | ||
@@ -295,0 +295,0 @@ |
@@ -8,2 +8,3 @@ import {DivOverlay} from './DivOverlay'; | ||
import {Path} from './vector/Path'; | ||
import {FeatureGroup} from './FeatureGroup'; | ||
@@ -258,6 +259,13 @@ /* | ||
_adjustPan: function (e) { | ||
_adjustPan: function () { | ||
if (!this.options.autoPan) { return; } | ||
if (this._map._panAnim) { this._map._panAnim.stop(); } | ||
// We can endlessly recurse if keepInView is set and the view resets. | ||
// Let's guard against that by exiting early if we're responding to our own autopan. | ||
if (this._autopanning) { | ||
this._autopanning = false; | ||
return; | ||
} | ||
var map = this._map, | ||
@@ -297,5 +305,10 @@ marginBottom = parseInt(DomUtil.getStyle(this._container, 'marginBottom'), 10) || 0, | ||
if (dx || dy) { | ||
// Track that we're autopanning, as this function will be re-ran on moveend | ||
if (this.options.keepInView) { | ||
this._autopanning = true; | ||
} | ||
map | ||
.fire('autopanstart') | ||
.panBy([dx, dy], {animate: e && e.type === 'moveend'}); | ||
.panBy([dx, dy]); | ||
} | ||
@@ -414,6 +427,10 @@ }, | ||
openPopup: function (latlng) { | ||
if (this._popup && this._popup._prepareOpen(latlng || this._latlng)) { | ||
// open the popup on the map | ||
this._popup.openOn(this._map); | ||
if (this._popup) { | ||
if (!(this instanceof FeatureGroup)) { | ||
this._popup._source = this; | ||
} | ||
if (this._popup._prepareOpen(latlng || this._latlng)) { | ||
// open the popup on the map | ||
this._popup.openOn(this._map); | ||
} | ||
} | ||
@@ -420,0 +437,0 @@ return this; |
@@ -8,2 +8,3 @@ import {DivOverlay} from './DivOverlay'; | ||
import * as Util from '../core/Util'; | ||
import {FeatureGroup} from './FeatureGroup'; | ||
@@ -331,10 +332,15 @@ /* | ||
openTooltip: function (latlng) { | ||
if (this._tooltip && this._tooltip._prepareOpen(latlng)) { | ||
// open the tooltip on the map | ||
this._tooltip.openOn(this._map); | ||
if (this._tooltip) { | ||
if (!(this instanceof FeatureGroup)) { | ||
this._tooltip._source = this; | ||
} | ||
if (this._tooltip._prepareOpen(latlng)) { | ||
// open the tooltip on the map | ||
this._tooltip.openOn(this._map); | ||
if (this.getElement) { | ||
this._setAriaDescribedByOnLayer(this); | ||
} else if (this.eachLayer) { | ||
this.eachLayer(this._setAriaDescribedByOnLayer, this); | ||
if (this.getElement) { | ||
this._setAriaDescribedByOnLayer(this); | ||
} else if (this.eachLayer) { | ||
this.eachLayer(this._setAriaDescribedByOnLayer, this); | ||
} | ||
} | ||
@@ -341,0 +347,0 @@ } |
@@ -154,7 +154,12 @@ import {Map} from '../Map'; | ||
map.panBy(offset); | ||
if (map.options.maxBounds) { | ||
map.panInsideBounds(map.options.maxBounds); | ||
offset = map._limitOffset(toPoint(offset), map.options.maxBounds); | ||
} | ||
if (map.options.worldCopyJump) { | ||
var newLatLng = map.wrapLatLng(map.unproject(map.project(map.getCenter()).add(offset))); | ||
map.panTo(newLatLng); | ||
} else { | ||
map.panBy(offset); | ||
} | ||
} | ||
@@ -161,0 +166,0 @@ } else if (key in this._zoomKeys) { |
@@ -1115,3 +1115,3 @@ import * as Util from '../core/Util'; | ||
if (position !== 'absolute' && position !== 'relative' && position !== 'fixed') { | ||
if (position !== 'absolute' && position !== 'relative' && position !== 'fixed' && position !== 'sticky') { | ||
container.style.position = 'relative'; | ||
@@ -1547,3 +1547,3 @@ } | ||
// an infinite loop of tiny offsets. | ||
if (offset.round().equals([0, 0])) { | ||
if (Math.abs(offset.x) <= 1 && Math.abs(offset.y) <= 1) { | ||
return center; | ||
@@ -1550,0 +1550,0 @@ } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3716811
36837