core: fixed mouse plugin event binding - now binds events with the namespace this.widgetName

This commit is contained in:
Paul Bakaus 2008-05-29 16:43:04 +00:00
parent 8c1d775315
commit cd2adeb725

View File

@ -160,7 +160,7 @@
mouseInit: function() { mouseInit: function() {
var self = this; var self = this;
this.element.bind('mousedown.mouse', function(e) { this.element.bind('mousedown.'+this.widgetName, function(e) {
return self.mouseDown(e); return self.mouseDown(e);
}); });
@ -176,7 +176,7 @@
// TODO: make sure destroying one instance of mouse doesn't mess with // TODO: make sure destroying one instance of mouse doesn't mess with
// other instances of mouse // other instances of mouse
mouseDestroy: function() { mouseDestroy: function() {
this.element.unbind('.mouse'); this.element.unbind('.'+this.widgetName);
// Restore text selection in IE // Restore text selection in IE
($.browser.msie ($.browser.msie
@ -211,8 +211,8 @@
return self.mouseUp(e); return self.mouseUp(e);
}; };
$(document) $(document)
.bind('mousemove.mouse', this._mouseMoveDelegate) .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
.bind('mouseup.mouse', this._mouseUpDelegate); .bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
return false; return false;
}, },
@ -239,8 +239,8 @@
mouseUp: function(e) { mouseUp: function(e) {
$(document) $(document)
.unbind('mousemove.mouse', this._mouseMoveDelegate) .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
.unbind('mouseup.mouse', this._mouseUpDelegate); .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
if (this._mouseStarted) { if (this._mouseStarted) {
this._mouseStarted = false; this._mouseStarted = false;