End drag events on mouseout of document, fixes #1277

This commit is contained in:
Tom MacWright 2013-06-24 14:33:01 -04:00
parent 130d6d0fac
commit baef8e1ffe

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) {
@ -138,6 +142,7 @@ L.Draggable = L.Class.extend({
},
_onUp: function (e) {
console.log('here');
var first, el, dist, simulateClickTouch, i;
clearTimeout(this._longPressTimeout);