]> source.dussan.org Git - jquery-ui.git/commitdiff
draggable: removed adding the class ui-draggable in favor of the new data selector
authorPaul Bakaus <paul.bakaus@googlemail.com>
Mon, 14 Jul 2008 14:24:00 +0000 (14:24 +0000)
committerPaul Bakaus <paul.bakaus@googlemail.com>
Mon, 14 Jul 2008 14:24:00 +0000 (14:24 +0000)
ui/ui.draggable.js

index e22806b2e6c40dcf3fde6979a86b32e204b61281..10bc32e52ff02f273557e40845815b00bbb73689 100644 (file)
@@ -28,7 +28,6 @@ $.widget("ui.draggable", $.extend({}, $.ui.mouse, {
                if (o.helper == 'original' && !positioned.test(position))
                        style.position = 'relative';
 
-               this.element.addClass('ui-draggable');
                (o.disabled && this.element.addClass('ui-draggable-disabled'));
                
                this.mouseInit();
@@ -264,7 +263,7 @@ $.widget("ui.draggable", $.extend({}, $.ui.mouse, {
        },
        destroy: function() {
                if(!this.element.data('draggable')) return;
-               this.element.removeData("draggable").unbind(".draggable").removeClass('ui-draggable');
+               this.element.removeData("draggable").unbind(".draggable").removeClass('ui-draggable-dragging ui-draggable-disabled');
                this.mouseDestroy();
        }
 }));
@@ -388,7 +387,7 @@ $.ui.plugin.add("draggable", "snap", {
                
                var inst = $(this).data("draggable");
                inst.snapElements = [];
-               $(ui.options.snap === true ? '.ui-draggable' : ui.options.snap).each(function() {
+               $(ui.options.snap === true ? ':data(draggable)' : ui.options.snap).each(function() {
                        var $t = $(this); var $o = $t.offset();
                        if(this != inst.element[0]) inst.snapElements.push({
                                item: this,