From 9a5f7b46757270c26c82eaa8516d42c6410b0b0a Mon Sep 17 00:00:00 2001 From: ilya Date: Sun, 29 Aug 2010 20:23:20 -0700 Subject: [PATCH 1/2] IZ now the bg color of the moved people changes to blue and changes back to white when you move them back, still need to reset to white on submit and make it pretty --- public/javascripts/group-edit.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/public/javascripts/group-edit.js b/public/javascripts/group-edit.js index 08644e6ad..c8c3f7e89 100644 --- a/public/javascripts/group-edit.js +++ b/public/javascripts/group-edit.js @@ -19,12 +19,13 @@ $(function() { move[ 'from' ] = ui.draggable[0].getAttribute('from_group_id'); if (move['to'] == move['from']){ $('#group_list').data( ui.draggable[0].id, []); + ui.draggable.css('background-color','white'); } else{ $('#group_list').data( ui.draggable[0].id, move); + ui.draggable.css('background-color','blue'); } - - $(this).closest("ul").append(ui.draggable) - } + $(this).closest("ul").append(ui.draggable); + } }); From 82ff7dc4e4320de329581d4f527f8ee2bed6e2c4 Mon Sep 17 00:00:00 2001 From: ilya Date: Sun, 29 Aug 2010 20:38:59 -0700 Subject: [PATCH 2/2] the person bg color now reset to white, need to reset the original group param and reset the moves var so that one can submit again --- public/javascripts/group-edit.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/javascripts/group-edit.js b/public/javascripts/group-edit.js index c8c3f7e89..9cc0c0f30 100644 --- a/public/javascripts/group-edit.js +++ b/public/javascripts/group-edit.js @@ -3,6 +3,7 @@ $('#move_friends_link').live( 'click', $.post('/groups/move_friends', {'moves' : $('#group_list').data()}, function(){ $('#group_title').html("Groups edited successfully!");}); + $(".person").css('background-color','white'); }); $(function() { @@ -22,7 +23,7 @@ $(function() { ui.draggable.css('background-color','white'); } else{ $('#group_list').data( ui.draggable[0].id, move); - ui.draggable.css('background-color','blue'); + ui.draggable.css('background-color','orange'); } $(this).closest("ul").append(ui.draggable); }