mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Draggable: Added exclude option without backCompat
This commit is contained in:
parent
0e65dec8c4
commit
25cf569c63
9
ui/jquery.ui.draggable.js
vendored
9
ui/jquery.ui.draggable.js
vendored
@ -32,7 +32,8 @@ $.widget( "ui.draggable", $.ui.interaction, {
|
|||||||
options: {
|
options: {
|
||||||
appendTo: null,
|
appendTo: null,
|
||||||
handle: null,
|
handle: null,
|
||||||
helper: false
|
helper: false,
|
||||||
|
exclude: "input,textarea,button,select,option"
|
||||||
},
|
},
|
||||||
|
|
||||||
// dragEl: element being dragged (original or helper)
|
// dragEl: element being dragged (original or helper)
|
||||||
@ -63,7 +64,11 @@ $.widget( "ui.draggable", $.ui.interaction, {
|
|||||||
/** interaction interface **/
|
/** interaction interface **/
|
||||||
|
|
||||||
_isValidTarget: function( element ) {
|
_isValidTarget: function( element ) {
|
||||||
return this.options.handle ? element.is( this.options.handle ) : true;
|
|
||||||
|
var handle = this.options.handle ? element.is( this.options.handle ) : true,
|
||||||
|
exclude = this.options.exclude ? element.is( this.options.exclude ) : false;
|
||||||
|
|
||||||
|
return ( handle && !exclude );
|
||||||
},
|
},
|
||||||
|
|
||||||
_start: function( event, pointerPosition ) {
|
_start: function( event, pointerPosition ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user