diaspora/app/views/aspects/create.js.erb
Florian Staudacher 4cbae601e8 [WIP] aspect membership dropdown Backbone.js rework
* initial backbone port
* changed AspectMembershipsController#destroy to use aspect_membership_id
* included rudimentary jasmine specs
* more specs, updating the list elements after de-/selection
* update selected aspect count on button
* don't even try to render html in AspectMembershipsController
* more specs for button summary text
* adapt aspect management on contacts page and in the popup boxes
* adapt inline creation of aspects + memberships

TODO
* more tests
2013-02-17 13:40:10 +01:00

17 lines
665 B
Text

// 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");
}