Merge pull request #1780 from Leaflet/iframe-mouseout

Iframe mouseout
This commit is contained in:
Vladimir Agafonkin 2013-06-24 12:25:26 -07:00
commit 34ce6e6eba

View File

@ -99,6 +99,10 @@ L.Draggable = L.Class.extend({
L.DomEvent
.on(document, L.Draggable.MOVE[e.type], this._onMove, this)
.on(document, L.Draggable.END[e.type], this._onUp, this);
if (e.type === 'mousedown') {
L.DomEvent.on(document, 'mouseout', this._onUp, this);
}
},
_onMove: function (e) {
@ -169,6 +173,8 @@ L.Draggable = L.Class.extend({
.off(document, L.Draggable.END[i], this._onUp);
}
L.DomEvent.off(document, 'mouseout', this._onUp);
if (this._moved) {
// ensure drag is not fired after dragend
L.Util.cancelAnimFrame(this._animRequest);