Skip to content
Snippets Groups Projects
Commit 70795279 authored by Sarah Mei's avatar Sarah Mei
Browse files

Merge branch 'master' of github.com:diaspora/diaspora

parents 73f0e17f 84e19f83
No related branches found
No related tags found
No related merge requests found
...@@ -99,7 +99,7 @@ class AspectsController < ApplicationController ...@@ -99,7 +99,7 @@ class AspectsController < ApplicationController
flash[:error] = I18n.t 'aspects.add_to_aspect.failure' flash[:error] = I18n.t 'aspects.add_to_aspect.failure'
end end
redirect_to aspects_path(params[:aspect_id]) redirect_to aspect_path(params[:aspect_id])
end end
def remove_from_aspect def remove_from_aspect
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
-else -else
-for person in aspect.people -for person in aspect.people
%li.person{:id => person.id, :from_aspect_id => aspect.id} %li.person{:id => person.id, :class => person.id, :from_aspect_id => aspect.id}
= person_image_tag(person) = person_image_tag(person)
.name .name
= link_to person.real_name, person = link_to person.real_name, person
......
...@@ -89,28 +89,36 @@ $(function() { ...@@ -89,28 +89,36 @@ $(function() {
} }
$(ui.draggable[0]).fadeOut('slow'); // ui.draggable.fadeOut('slow') $(ui.draggable[0]).fadeOut('slow');
$(ui.draggable[0]).remove();
} }
}); });
$(".aspect_remove ul").droppable({ $(".aspect_remove ul").droppable({
hoverClass: 'active', hoverClass: 'active',
drop: function(event, ui) { drop: function(event, ui) {
if ($( "." + ui.draggable[0].id).length == 1) {
alert("You can not remove the person from the last aspect");
} else {
if (!$(ui.draggable[0]).hasClass('requested_person')){
var aspect = ui.draggable[0].getAttribute('from_aspect_id')
var person_id = ui.draggable[0].id
$.ajax({
type: "POST",
url: "/aspects/remove_from_aspect",
data:{
'friend_id' : person_id,
'aspect_id' : aspect
}
});
}
$(ui.draggable[0]).fadeOut('slow');
$(ui.draggable[0]).remove();
if (!$(ui.draggable[0]).hasClass('requested_person')){
var aspect = ui.draggable[0].getAttribute('from_aspect_id')
var person_id = ui.draggable[0].id
$.ajax({
type: "POST",
url: "/aspects/remove_from_aspect",
data:{
'friend_id' : person_id,
'aspect_id' : aspect
}
});
} }
$(ui.draggable[0]).fadeOut('slow'); // ui.draggable.fadeOut('slow')
} }
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment