feat(draggable): allow ignore_dragging config option to be a function

This commit is contained in:
vieron
2014-03-26 12:38:06 +01:00
parent f1ad03cc36
commit 69fcfe4596
+5 -1
View File
@@ -14,7 +14,7 @@
limit: true,
offset_left: 0,
autoscroll: true,
ignore_dragging: ['INPUT', 'TEXTAREA', 'SELECT', 'BUTTON'],
ignore_dragging: ['INPUT', 'TEXTAREA', 'SELECT', 'BUTTON'], // or function
handle: null,
container_width: 0, // 0 == auto
move_element: true,
@@ -387,6 +387,10 @@
return !$(event.target).is(this.options.handle);
}
if ($.isFunction(this.options.ignore_dragging)) {
return this.options.ignore_dragging(event);
}
return $(event.target).is(this.options.ignore_dragging.join(', '));
};