addded slideToggle
This commit is contained in:
parent
2b6165d8ea
commit
6cc085d64e
3 changed files with 19 additions and 9 deletions
|
|
@ -31,11 +31,11 @@ class Services::Facebook < Service
|
|||
},
|
||||
{
|
||||
"name": "Person to Invite",
|
||||
"id": "abc123"
|
||||
"id": "e3"
|
||||
},
|
||||
{
|
||||
"name": "Creative Commons",
|
||||
"id": "ccby"
|
||||
"id": "b2"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
10
db/seeds.rb
10
db/seeds.rb
|
|
@ -15,9 +15,9 @@ require 'factory_girl_rails'
|
|||
require 'spec/helper_methods'
|
||||
include HelperMethods
|
||||
|
||||
alice = Factory(:user_with_aspect, :username => "alice", :password => 'evankorth')
|
||||
bob = Factory(:user_with_aspect, :username => "bob", :password => 'evankorth')
|
||||
eve = Factory(:user_with_aspect, :username => "eve", :password => 'evankorth')
|
||||
alice = Factory(:user_with_aspect, :username => "alice", :password => 'evankorth', :invites => 10)
|
||||
bob = Factory(:user_with_aspect, :username => "bob", :password => 'evankorth', :invites => 10)
|
||||
eve = Factory(:user_with_aspect, :username => "eve", :password => 'evankorth', :invites => 10)
|
||||
|
||||
alice.person.profile.update_attributes(:first_name => "Alice", :last_name => "Smith")
|
||||
bob.person.profile.update_attributes(:first_name => "Bob", :last_name => "Grimm")
|
||||
|
|
@ -25,3 +25,7 @@ eve.person.profile.update_attributes(:first_name => "Eve", :last_name => "Doe")
|
|||
|
||||
connect_users(bob, bob.aspects.first, alice, alice.aspects.first)
|
||||
connect_users(bob, bob.aspects.first, eve, eve.aspects.first)
|
||||
|
||||
alice.services << Services::Facebook.create(:user_id => alice.id, :uid => 'a1')
|
||||
bob.services << Services::Facebook.create(:user_id => bob.id, :uid => 'b2')
|
||||
eve.services << Services::Facebook.create(:user_id => eve.id, :uid => 'e3')
|
||||
|
|
|
|||
|
|
@ -6,12 +6,18 @@
|
|||
var FriendFinder = {
|
||||
|
||||
initialize: function() {
|
||||
alert("party time");
|
||||
$('.contact_list .button').click(function(){
|
||||
$this = $(this);
|
||||
var uid = $this.parent('li').attr("uid");
|
||||
alert(uid);
|
||||
$this.closest("options_"+uid).toggleClass("hidden").slideDown('slow', function(){});
|
||||
var uid = $this.parents('li').attr("uid");
|
||||
$this.parents('ul').children("#options_"+uid).slideToggle(function(){
|
||||
if($this.text() == 'Done'){
|
||||
$this.text($this.attr('old-text'));
|
||||
} else {
|
||||
$this.attr('old-text', $this.text());
|
||||
$this.text('Done');
|
||||
}
|
||||
$(this).toggleClass('hidden');
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue