mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Draggable: Add ui-draggable class.
This commit is contained in:
parent
1337573adc
commit
e1e43e3109
9
ui/jquery.ui.draggable.js
vendored
9
ui/jquery.ui.draggable.js
vendored
@ -41,6 +41,7 @@ $.widget( "ui.draggable", {
|
|||||||
this.element.css( "position", "relative" );
|
this.element.css( "position", "relative" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.element.addClass( "ui-draggable" );
|
||||||
this._bind({ mousedown: "_mouseDown" });
|
this._bind({ mousedown: "_mouseDown" });
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -56,7 +57,7 @@ $.widget( "ui.draggable", {
|
|||||||
|
|
||||||
// Take into account scrollbar
|
// Take into account scrollbar
|
||||||
position.top -= scrollTop;
|
position.top -= scrollTop;
|
||||||
position.left -= scrollLeft
|
position.left -= scrollLeft;
|
||||||
|
|
||||||
return position;
|
return position;
|
||||||
}
|
}
|
||||||
@ -258,7 +259,7 @@ $.widget( "ui.draggable", {
|
|||||||
this.tempPosition = {
|
this.tempPosition = {
|
||||||
left: newLeft,
|
left: newLeft,
|
||||||
top: newTop
|
top: newTop
|
||||||
}
|
};
|
||||||
|
|
||||||
// Refresh offset cache with new positions
|
// Refresh offset cache with new positions
|
||||||
this.offset.left = this.startOffset.left + newLeft;
|
this.offset.left = this.startOffset.left + newLeft;
|
||||||
@ -297,6 +298,10 @@ $.widget( "ui.draggable", {
|
|||||||
position: this.position,
|
position: this.position,
|
||||||
offset: this.offset
|
offset: this.offset
|
||||||
};
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
_destroy: function() {
|
||||||
|
this.element.removeClass( "ui-draggable" );
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user