aboutsummaryrefslogtreecommitdiffstats
path: root/ui/ui.draggable.js
diff options
context:
space:
mode:
authorRichard Worth <rdworth@gmail.com>2009-02-02 06:45:50 +0000
committerRichard Worth <rdworth@gmail.com>2009-02-02 06:45:50 +0000
commitc5df36e277ffef271790ff6d27af47ef64858deb (patch)
treef9fa1d6467359c65b9b9fda3fd09bc05d2b0c72e /ui/ui.draggable.js
parentc42164097caca488ac1b1761a6678793f2c3322f (diff)
downloadjquery-ui-c5df36e277ffef271790ff6d27af47ef64858deb.tar.gz
jquery-ui-c5df36e277ffef271790ff6d27af47ef64858deb.zip
Fixed #4036 (draggable: cssNamespace option should be removed, addClasses option added)
Diffstat (limited to 'ui/ui.draggable.js')
-rw-r--r--ui/ui.draggable.js19
1 files changed, 12 insertions, 7 deletions
diff --git a/ui/ui.draggable.js b/ui/ui.draggable.js
index 2fc541f95..58c000eae 100644
--- a/ui/ui.draggable.js
+++ b/ui/ui.draggable.js
@@ -19,8 +19,8 @@ $.widget("ui.draggable", $.extend({}, $.ui.mouse, {
if (this.options.helper == 'original' && !(/^(?:r|a|f)/).test(this.element.css("position")))
this.element[0].style.position = 'relative';
- (this.options.cssNamespace && this.element.addClass(this.options.cssNamespace+"-draggable"));
- (this.options.disabled && this.element.addClass(this.options.cssNamespace+'-draggable-disabled'));
+ (this.options.addClasses && this.element.addClass("ui-draggable"));
+ (this.options.disabled && this.element.addClass("ui-draggable-disabled"));
this._mouseInit();
@@ -28,7 +28,12 @@ $.widget("ui.draggable", $.extend({}, $.ui.mouse, {
destroy: function() {
if(!this.element.data('draggable')) return;
- this.element.removeData("draggable").unbind(".draggable").removeClass(this.options.cssNamespace+'-draggable '+this.options.cssNamespace+'-draggable-dragging '+this.options.cssNamespace+'-draggable-disabled');
+ this.element
+ .removeData("draggable")
+ .unbind(".draggable")
+ .removeClass("ui-draggable"
+ + " ui-draggable-dragging"
+ + " ui-draggable-disabled");
this._mouseDestroy();
},
@@ -36,7 +41,7 @@ $.widget("ui.draggable", $.extend({}, $.ui.mouse, {
var o = this.options;
- if (this.helper || o.disabled || $(event.target).is('.'+this.options.cssNamespace+'-resizable-handle'))
+ if (this.helper || o.disabled || $(event.target).is('.ui-resizable-handle'))
return false;
//Quit if we're not on a valid handle
@@ -113,7 +118,7 @@ $.widget("ui.draggable", $.extend({}, $.ui.mouse, {
if ($.ui.ddmanager && !o.dropBehaviour)
$.ui.ddmanager.prepareOffsets(this, event);
- this.helper.addClass(o.cssNamespace+"-draggable-dragging");
+ this.helper.addClass("ui-draggable-dragging");
this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position
return true;
},
@@ -365,7 +370,7 @@ $.widget("ui.draggable", $.extend({}, $.ui.mouse, {
},
_clear: function() {
- this.helper.removeClass(this.options.cssNamespace+"-draggable-dragging");
+ this.helper.removeClass("ui-draggable-dragging");
if(this.helper[0] != this.element[0] && !this.cancelHelperRemoval) this.helper.remove();
//if($.ui.ddmanager) $.ui.ddmanager.current = null;
this.helper = null;
@@ -398,12 +403,12 @@ $.extend($.ui.draggable, {
version: "@VERSION",
eventPrefix: "drag",
defaults: {
+ addClasses: true,
appendTo: "parent",
axis: false,
cancel: ":input,option",
connectToSortable: false,
containment: false,
- cssNamespace: "ui",
cursor: "auto",
cursorAt: false,
delay: 0,