From: Timo Tijhof Date: Sat, 28 Apr 2018 00:16:03 +0000 (+0100) Subject: jquery.ui: Use on() instead of deprecated bind() in jquery.ui.mouse X-Git-Tag: 1.34.0-rc.0~5577^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/%22%24encUrl/%24fid?a=commitdiff_plain;h=a0e22fb474640e3070b5911c5accc0d7821f9333;p=lhc%2Fweb%2Fwiklou.git jquery.ui: Use on() instead of deprecated bind() in jquery.ui.mouse Frequently seen on Beta Cluster due to indirect usage from PageTriage extension. Bug: T169385 Change-Id: Ia49ad6470aef1bcb1dd91c779dcd108a0a98d4dc --- diff --git a/resources/lib/jquery.ui/PATCHES b/resources/lib/jquery.ui/PATCHES index 321b8b9eb0..0450ec81a2 100644 --- a/resources/lib/jquery.ui/PATCHES +++ b/resources/lib/jquery.ui/PATCHES @@ -16,6 +16,11 @@ jquery.ui.datepicker * I717f2580e Avoid deprecated jQuery.expr.filters. +jquery.ui.mouse.js +* Ia49ad6470 Avoid deprecated jQuery.fn.bind(). +* Ia49ad6470 Avoid deprecated jQuery.fn.unbind(). + + jquery.ui.widget.js * I7ffbfd2e5 Avoid deprecated jQuery.expr[":"]. * I717f2580e Avoid deprecated jQuery.fn.bind(). diff --git a/resources/lib/jquery.ui/jquery.ui.mouse.js b/resources/lib/jquery.ui/jquery.ui.mouse.js index 250365fe72..83d8e5308b 100644 --- a/resources/lib/jquery.ui/jquery.ui.mouse.js +++ b/resources/lib/jquery.ui/jquery.ui.mouse.js @@ -29,10 +29,10 @@ $.widget("ui.mouse", { 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(); @@ -46,11 +46,11 @@ $.widget("ui.mouse", { // 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); } }, @@ -100,8 +100,8 @@ $.widget("ui.mouse", { 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(); @@ -131,8 +131,8 @@ $.widget("ui.mouse", { _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;