marcinf2
marcinf2

Reputation: 83

Making dropped clone element draggable again

I have a few table-blocks, and whole table with workout cells . When dragging I use helper to clone .table-block and later I append it to .workout-cell on drop. When dropped to .workout cell I can't move it anymore. I want to make it draggable again within the table, and be able to move it. How to do this?

Here is code:

$( ".table-block" ).draggable({     
  helper : "clone", 
});

$(".workout-cell").droppable({
  drop: function(ev, ui) {
    var element=$(ui.draggable).clone();
    $(this).append(element);
  }
});

Upvotes: 1

Views: 1454

Answers (1)

user229044
user229044

Reputation: 239501

You need to call .draggable on the cloned element:

$(".workout-cell").droppable({
  drop: function(ev, ui) {
    var element=$(ui.draggable).clone();
    $(this).append(element);
    $(element).draggable({helper: 'clone'});
  }
});

Upvotes: 2

Related Questions