Skip to content

Commit 69fcfe4

Browse files
committed
feat(draggable): allow ignore_dragging config option to be a function
1 parent f1ad03c commit 69fcfe4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/jquery.draggable.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limit: true,
1515
offset_left: 0,
1616
autoscroll: true,
17-
ignore_dragging: ['INPUT', 'TEXTAREA', 'SELECT', 'BUTTON'],
17+
ignore_dragging: ['INPUT', 'TEXTAREA', 'SELECT', 'BUTTON'], // or function
1818
handle: null,
1919
container_width: 0, // 0 == auto
2020
move_element: true,
@@ -387,6 +387,10 @@
387387
return !$(event.target).is(this.options.handle);
388388
}
389389

390+
if ($.isFunction(this.options.ignore_dragging)) {
391+
return this.options.ignore_dragging(event);
392+
}
393+
390394
return $(event.target).is(this.options.ignore_dragging.join(', '));
391395
};
392396

0 commit comments

Comments
 (0)