Skip to content
Extraits de code Groupes Projets
Valider 990be921 rédigé par ilya's avatar ilya
Parcourir les fichiers

added an switch to reset the data if the thing is moved into the original group

parent cf161cb8
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -12,13 +12,18 @@ $(function() { ...@@ -12,13 +12,18 @@ $(function() {
$(".group ul").droppable({ $(".group ul").droppable({
drop: function(event, ui) { drop: function(event, ui) {
$(this).closest("ul").append(ui.draggable)
//$("<li class='person ui-draggable'></li>").text(ui.draggable.text()).appendTo(this).draggable(); //$("<li class='person ui-draggable'></li>").text(ui.draggable.text()).appendTo(this).draggable();
var move = {}; var move = {};
move[ 'friend_id' ] = ui.draggable[0].id move[ 'friend_id' ] = ui.draggable[0].id
move[ 'to' ] = $(this)[0].id; move[ 'to' ] = $(this)[0].id;
move[ 'from' ] = ui.draggable[0].getAttribute('from_group_id'); move[ 'from' ] = ui.draggable[0].getAttribute('from_group_id');
$('#group_list').data( ui.draggable[0].id, move); if (move['to'] == move['from']){
$('#group_list').data( ui.draggable[0].id, []);
} else{
$('#group_list').data( ui.draggable[0].id, move);
}
$(this).closest("ul").append(ui.draggable)
} }
}); });
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter