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 ) {
widget._bind( widget.document, {
"mousemove": function( event ) {
function mousemove( event ) {
event.preventDefault();
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
});
}
};