summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorKato Kazuyoshi <kato.kazuyoshi@gmail.com>2011-05-11 13:06:53 -0400
committerScott González <scott.gonzalez@gmail.com>2011-05-11 13:07:50 -0400
commit201b5ed48c0b848a38e8e43c4f187c44e2e16ddd (patch)
treedf750712912f5a105d5d0c3872ecf42a4389b89d /ui
parent5e1032ec74feba976c91de275605174c87710a6a (diff)
downloadjquery-ui-201b5ed48c0b848a38e8e43c4f187c44e2e16ddd.tar.gz
jquery-ui-201b5ed48c0b848a38e8e43c4f187c44e2e16ddd.zip
Draggable: Remove id when cloning helpers. Fixes #4564 - Draggable+Sortable Demo duplicates DOM Ids.
(cherry picked from commit 98fcb477d6a7091b21e9b7bc0b8c28f798954d47)
Diffstat (limited to 'ui')
-rw-r--r--ui/jquery.ui.draggable.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/ui/jquery.ui.draggable.js b/ui/jquery.ui.draggable.js
index cf08e4798..26468b489 100644
--- a/ui/jquery.ui.draggable.js
+++ b/ui/jquery.ui.draggable.js
@@ -261,7 +261,7 @@ $.widget("ui.draggable", $.ui.mouse, {
_createHelper: function(event) {
var o = this.options;
- var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper == 'clone' ? this.element.clone() : this.element);
+ var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper == 'clone' ? this.element.clone().removeAttr('id') : this.element);
if(!helper.parents('body').length)
helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo));
@@ -580,7 +580,7 @@ $.ui.plugin.add("draggable", "connectToSortable", {
//Now we fake the start of dragging for the sortable instance,
//by cloning the list group item, appending it to the sortable and using it as inst.currentItem
//We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one)
- this.instance.currentItem = $(self).clone().appendTo(this.instance.element).data("sortable-item", true);
+ this.instance.currentItem = $(self).clone().removeAttr('id').appendTo(this.instance.element).data("sortable-item", true);
this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it
this.instance.options.helper = function() { return ui.helper[0]; };