removing aspect in ui only if ok is clicked on confirmation

This commit is contained in:
Derrick Camerino 2010-11-02 22:17:47 -07:00 committed by Raphael
parent 7cb034ec9d
commit 087f7e90d4
2 changed files with 4 additions and 2 deletions

View file

@ -11,7 +11,9 @@
$(".aspects li").find(".delete").live("click", function(){ $(".aspects li").find(".delete").live("click", function(){
var aspectElement = $(this).parent("li"); var aspectElement = $(this).parent("li");
aspectElement.fadeOut(300, function(){aspectElement.remove();}); if (confirm("are you sure?")){
aspectElement.fadeOut(300, function(){aspectElement.remove();});
}
}); });
- if current_user.getting_started == true - if current_user.getting_started == true

View file

@ -28,7 +28,7 @@
#add_request_pane #add_request_pane
= render "requests/new_request", :aspect => aspect, :getting_started => 2 = render "requests/new_request", :aspect => aspect, :getting_started => 2
= link_to "x", aspect_path(aspect), :confirm => "are you sure?", :method => :delete, :remote => true, :class => "delete right" = link_to "x", aspect_path(aspect), :method => :delete, :remote => true, :class => "delete right"
%br %br
%br %br