fixed listener for delete action on aspect-edit. scope through a manage_aspect_zones div to avoid confusion on aspects#show.
This commit is contained in:
parent
5ae8a06016
commit
2c22941e2f
3 changed files with 46 additions and 45 deletions
|
|
@ -10,54 +10,55 @@
|
|||
.right{:style=>"top:0;"}
|
||||
= link_to("+ #{t('.add_a_new_aspect')}", "#add_aspect_pane", :class => "new_aspect add_aspect_button button", :title => t('.add_a_new_aspect'))
|
||||
|
||||
.span-4.append-1.last
|
||||
%h3=t('.requests')
|
||||
#manage_aspect_zones
|
||||
.span-4.append-1.last
|
||||
%h3=t('.requests')
|
||||
|
||||
.requests
|
||||
%i
|
||||
%p= "#{t('.drag_to_add')} =>"
|
||||
.requests
|
||||
%i
|
||||
%p= "#{t('.drag_to_add')} =>"
|
||||
|
||||
%ul.dropzone
|
||||
- if @remote_requests.size < 1
|
||||
%li=t('.no_requests')
|
||||
- else
|
||||
- for request in @remote_requests
|
||||
%li.person.request{:data=>{:guid=>request.id, :person_id=>request.from.id}}
|
||||
.delete
|
||||
.x
|
||||
X
|
||||
.circle
|
||||
= link_to person_image_tag(request.from), request.from
|
||||
|
||||
= render 'shared/invitations', :invites => @invites
|
||||
|
||||
.span-19.last
|
||||
%ul#aspect_list
|
||||
- for aspect in @aspects
|
||||
%li.aspect{:data=>{:guid=>aspect.id}}
|
||||
|
||||
.aspect_name
|
||||
%span.edit_name_field
|
||||
%h3{:contenteditable=>true}
|
||||
= aspect.name
|
||||
%span.tip click to edit
|
||||
|
||||
%ul.tools
|
||||
%li= link_to t('.add_a_new_contact'), "#manage_aspect_contacts_pane_#{aspect.id}", :class => 'manage_aspect_contacts_button'
|
||||
%li!= remove_link(aspect)
|
||||
|
||||
%ul.dropzone{:data=>{:aspect_id=>aspect.id}}
|
||||
-for contact in aspect.contacts
|
||||
%li.person{:data=>{:guid=>contact.person.id, :aspect_id=>aspect.id}}
|
||||
%ul.dropzone
|
||||
- if @remote_requests.size < 1
|
||||
%li=t('.no_requests')
|
||||
- else
|
||||
- for request in @remote_requests
|
||||
%li.person.request{:data=>{:guid=>request.id, :person_id=>request.from.id}}
|
||||
.delete
|
||||
.x
|
||||
X
|
||||
.circle
|
||||
= link_to person_image_tag(contact.person), contact.person
|
||||
.draggable_info
|
||||
=t('.drag_to_add')
|
||||
= link_to person_image_tag(request.from), request.from
|
||||
|
||||
.fancybox_content
|
||||
%div{:id => "manage_aspect_contacts_pane_#{aspect.id}"}
|
||||
= render "requests/manage_aspect_contacts", :aspect_name => aspect.name, :aspect_id => aspect.id, :manage => true
|
||||
= render 'shared/invitations', :invites => @invites
|
||||
|
||||
.span-19.last
|
||||
%ul#aspect_list
|
||||
- for aspect in @aspects
|
||||
%li.aspect{:data=>{:guid=>aspect.id}}
|
||||
|
||||
.aspect_name
|
||||
%span.edit_name_field
|
||||
%h3{:contenteditable=>true}
|
||||
= aspect.name
|
||||
%span.tip click to edit
|
||||
|
||||
%ul.tools
|
||||
%li= link_to t('.add_a_new_contact'), "#manage_aspect_contacts_pane_#{aspect.id}", :class => 'manage_aspect_contacts_button'
|
||||
%li!= remove_link(aspect)
|
||||
|
||||
%ul.dropzone{:data=>{:aspect_id=>aspect.id}}
|
||||
-for contact in aspect.contacts
|
||||
%li.person{:data=>{:guid=>contact.person.id, :aspect_id=>aspect.id}}
|
||||
.delete
|
||||
.x
|
||||
X
|
||||
.circle
|
||||
= link_to person_image_tag(contact.person), contact.person
|
||||
.draggable_info
|
||||
=t('.drag_to_add')
|
||||
|
||||
.fancybox_content
|
||||
%div{:id => "manage_aspect_contacts_pane_#{aspect.id}"}
|
||||
= render "requests/manage_aspect_contacts", :aspect_name => aspect.name, :aspect_id => aspect.id, :manage => true
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ var AspectEdit = {
|
|||
drop: AspectEdit.onDropMove
|
||||
});
|
||||
|
||||
$("#aspect_list").find(".delete").live("click", AspectEdit.deletePerson);
|
||||
$("#manage_aspect_zones").find(".delete").live("click", AspectEdit.deletePerson);
|
||||
$(".aspect h3").live('focus', AspectEdit.changeName);
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ describe("AspectEdit", function() {
|
|||
spyOn($.fn, "live");
|
||||
AspectEdit.initialize();
|
||||
expect($.fn.live).toHaveBeenCalledWith("click", AspectEdit.deletePerson);
|
||||
expect($.fn.live.calls[0].object.selector).toEqual(".delete");
|
||||
expect($.fn.live.calls[0].object.selector).toEqual("#manage_aspect_zones .delete");
|
||||
});
|
||||
it("sets up the focus event on aspect name", function() {
|
||||
spyOn($.fn, "live");
|
||||
|
|
|
|||
Loading…
Reference in a new issue