//   Copyright (c) 2010-2011, Diaspora Inc.  This file is
//   licensed under the Affero General Public License version 3 or later.  See
//   the COPYRIGHT file.

// TODO create the aspect and the new aspect membership via Backbone.js and then
// remove this view!

if( app.aspectMemberships ) {
  var dropdown = $("ul.dropdown_list[data-person_id=<%= @person.id %>]");
  $('.newItem', dropdown).before("<%= escape_javascript( aspect_dropdown_list_item(@aspect, @contact.aspects.include?(@aspect))) %>");

  app.aspectMemberships.dropdown = dropdown;
  app.aspectMemberships.updateSummary();

  $.facebox.close();
  $('#profile .dropdown').toggleClass("active");
}
