Draggable: Added disabled option

This commit is contained in:
Dave Stein 2012-12-10 17:20:11 -05:00
parent 94e475ba2d
commit 93dfd995df

View File

@ -33,7 +33,8 @@ $.widget( "ui.draggable", $.ui.interaction, {
appendTo: null,
handle: null,
helper: false,
exclude: "input,textarea,button,select,option"
exclude: "input,textarea,button,select,option",
disabled: false
},
// dragEl: element being dragged (original or helper)
@ -74,6 +75,11 @@ $.widget( "ui.draggable", $.ui.interaction, {
_start: function( event, pointerPosition ) {
var offset;
// Stop drag if option says disabled
if ( this.options.disabled === true ) {
return;
}
// The actual dragging element, should always be a jQuery object
this.dragEl = this.options.helper ?
this._createHelper( pointerPosition ) :