Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow using a Function as the cancel option instead of a Selector. #2324

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions ui/widgets/mouse.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,11 @@

var that = this,
btnIsLeft = event.which === 1,
elIsCancel = typeof this.options.cancel === "string" ?
$( event.target ).closest( this.options.cancel ).length :
false;
elIsCancel = typeof this.options.cancel === "function" ?
this.options.cancel.call(event.target, event) :

Check failure on line 94 in ui/widgets/mouse.js

View workflow job for this annotation

GitHub Actions / chrome | jQuery git

There must be a space after this paren

Check failure on line 94 in ui/widgets/mouse.js

View workflow job for this annotation

GitHub Actions / chrome | jQuery git

There must be a space before this paren

Check failure on line 94 in ui/widgets/mouse.js

View workflow job for this annotation

GitHub Actions / chrome | jQuery stable

There must be a space after this paren

Check failure on line 94 in ui/widgets/mouse.js

View workflow job for this annotation

GitHub Actions / chrome | jQuery stable

There must be a space before this paren

Check failure on line 94 in ui/widgets/mouse.js

View workflow job for this annotation

GitHub Actions / firefox | jQuery git

There must be a space after this paren

Check failure on line 94 in ui/widgets/mouse.js

View workflow job for this annotation

GitHub Actions / firefox | jQuery git

There must be a space before this paren

Check failure on line 94 in ui/widgets/mouse.js

View workflow job for this annotation

GitHub Actions / firefox | jQuery stable

There must be a space after this paren

Check failure on line 94 in ui/widgets/mouse.js

View workflow job for this annotation

GitHub Actions / firefox | jQuery stable

There must be a space before this paren
( typeof this.options.cancel === "string" ?
$( event.target ).closest( this.options.cancel ).length :

Check failure on line 96 in ui/widgets/mouse.js

View workflow job for this annotation

GitHub Actions / chrome | jQuery git

Mixed spaces and tabs

Check failure on line 96 in ui/widgets/mouse.js

View workflow job for this annotation

GitHub Actions / chrome | jQuery stable

Mixed spaces and tabs

Check failure on line 96 in ui/widgets/mouse.js

View workflow job for this annotation

GitHub Actions / firefox | jQuery git

Mixed spaces and tabs

Check failure on line 96 in ui/widgets/mouse.js

View workflow job for this annotation

GitHub Actions / firefox | jQuery stable

Mixed spaces and tabs
false);

Check failure on line 97 in ui/widgets/mouse.js

View workflow job for this annotation

GitHub Actions / chrome | jQuery git

Mixed spaces and tabs

Check failure on line 97 in ui/widgets/mouse.js

View workflow job for this annotation

GitHub Actions / chrome | jQuery git

There must be a space before this paren

Check failure on line 97 in ui/widgets/mouse.js

View workflow job for this annotation

GitHub Actions / chrome | jQuery stable

Mixed spaces and tabs

Check failure on line 97 in ui/widgets/mouse.js

View workflow job for this annotation

GitHub Actions / chrome | jQuery stable

There must be a space before this paren

Check failure on line 97 in ui/widgets/mouse.js

View workflow job for this annotation

GitHub Actions / firefox | jQuery git

Mixed spaces and tabs

Check failure on line 97 in ui/widgets/mouse.js

View workflow job for this annotation

GitHub Actions / firefox | jQuery git

There must be a space before this paren

Check failure on line 97 in ui/widgets/mouse.js

View workflow job for this annotation

GitHub Actions / firefox | jQuery stable

Mixed spaces and tabs

Check failure on line 97 in ui/widgets/mouse.js

View workflow job for this annotation

GitHub Actions / firefox | jQuery stable

There must be a space before this paren
if ( !btnIsLeft || elIsCancel || !this._mouseCapture( event ) ) {
return true;
}
Expand Down
Loading