Interaction: Fixed unbinding of mousemove and mouseup event handlers.

This commit is contained in:
Scott González 2012-01-07 20:49:49 -05:00
parent ed463ab80c
commit 726d3f67c2

View File

@ -53,15 +53,21 @@ interaction.hooks.mouse = {
}, },
handle: function( widget ) { handle: function( widget ) {
widget._bind( widget.document, { function mousemove( event ) {
"mousemove": function( event ) {
event.preventDefault(); event.preventDefault();
widget._interactionMove( event ); widget._interactionMove( event );
},
"mouseup": function( event ) {
widget._interactionStop( event );
widget.document.unbind( "mousemove mouseup" );
} }
function mouseup( event ) {
widget._interactionStop( event );
widget.document
.unbind( "mousemove", mousemove )
.unbind( "mouseup", mouseup );
}
widget._bind( widget.document, {
"mousemove": mousemove,
"mouseup": mouseup
}); });
} }
}; };