var that = this;
this.element
- .bind('mousedown.'+this.widgetName, function(event) {
+ .on('mousedown.'+this.widgetName, function(event) {
return that._mouseDown(event);
})
- .bind('click.'+this.widgetName, function(event) {
+ .on('click.'+this.widgetName, function(event) {
if (true === $.data(event.target, that.widgetName + '.preventClickEvent')) {
$.removeData(event.target, that.widgetName + '.preventClickEvent');
event.stopImmediatePropagation();
// TODO: make sure destroying one instance of mouse doesn't mess with
// other instances of mouse
_mouseDestroy: function() {
- this.element.unbind('.'+this.widgetName);
+ this.element.off('.'+this.widgetName);
if ( this._mouseMoveDelegate ) {
$(document)
- .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
- .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
+ .off('mousemove.'+this.widgetName, this._mouseMoveDelegate)
+ .off('mouseup.'+this.widgetName, this._mouseUpDelegate);
}
},
return that._mouseUp(event);
};
$(document)
- .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
- .bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
+ .on('mousemove.'+this.widgetName, this._mouseMoveDelegate)
+ .on('mouseup.'+this.widgetName, this._mouseUpDelegate);
event.preventDefault();
_mouseUp: function(event) {
$(document)
- .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
- .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
+ .off('mousemove.'+this.widgetName, this._mouseMoveDelegate)
+ .off('mouseup.'+this.widgetName, this._mouseUpDelegate);
if (this._mouseStarted) {
this._mouseStarted = false;