Skip to content

Commit

Permalink
Fixed profile tab rendering by hiding, rendering, and then showing al…
Browse files Browse the repository at this point in the history
…l at once
  • Loading branch information
mhartl committed Oct 15, 2008
1 parent e3c75a4 commit bd00161
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 38 deletions.
2 changes: 1 addition & 1 deletion app/models/person.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class Person < ActiveRecord::Base
NUM_WALL_COMMENTS = 10
NUM_RECENT = 8
FEED_SIZE = 10
MAX_DEFAULT_CONTACTS = 6
MAX_DEFAULT_CONTACTS = 12
TIME_AGO_FOR_MOSTLY_ACTIVE = 1.month.ago
# These constants should be methods, but I couldn't figure out how to use
# methods in the has_many associations. I hope you can do better.
Expand Down
56 changes: 28 additions & 28 deletions app/views/people/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
<div>
<% tabs = TabsRenderer.new(self, :id => "tabCol") %>
<% tabs.create('tProfile', 'Profile', :class => "profile vcard") do %>
<%= render :partial => 'profile' %>
<div class="clear"></div>
<% end %>
<div id="profile" style="display: none;">
<% tabs = TabsRenderer.new(self, :id => "tabCol") %>
<% tabs.create('tProfile', 'Profile', :class => "profile vcard") do %>
<%= render :partial => 'profile' %>
<div class="clear"></div>
<% end %>

<% tabs.create('tWall', 'Wall') do %>
<%= render :partial => 'wall' %>
<div class="clear"></div>
<% end %>
<% tabs.create('tWall', 'Wall') do %>
<%= render :partial => 'wall' %>
<div class="clear"></div>
<% end %>

<% tabs.create('tRecentActivity', 'Recent Activity') do %>
<%= render :partial => 'recent_activity' %>
<div class="clear"></div>
<% end %>
<% tabs.create('tRecentActivity', 'Recent Activity') do %>
<%= render :partial => 'recent_activity' %>
<div class="clear"></div>
<% end %>

<% tabs.create('tContacts', 'Contacts') do %>
<%= render :partial => 'profile_contacts' %>
<div class="clear"></div>
<% end %>
<% tabs.create('tContacts', 'Contacts') do %>
<%= render :partial => 'profile_contacts' %>
<div class="clear"></div>
<% end %>

<% tabs.create('tBlog', 'Blog') do %>
<%= render :partial => 'shared/blog' %>
<div class="clear"></div>
<% end %>
<% tabs.create('tBlog', 'Blog') do %>
<%= render :partial => 'shared/blog' %>
<div class="clear"></div>
<% end %>

<% tabs.create('tGalleries', 'Galleries') do %>
<%= render :partial => "shared/galleries",
:locals => { :galleries => @galleries } %>
<div class="clear"></div>
<% end %>
<% tabs.create('tGalleries', 'Galleries') do %>
<%= render :partial => "shared/galleries",
:locals => { :galleries => @galleries } %>
<div class="clear"></div>
<% end %>

<%= tabs.render %>
<%= tabs.render %>
</div>
19 changes: 10 additions & 9 deletions public/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,23 @@
$(document).ready(function() {
// sets up the Profile page tabs
$("#tabCol > ul").tabs();
$("#profile").show()

// sets up the hover image for activity feed items
// sets up the hover image for activity feed items
$(".imgHoverMarker").tooltip({
showURL: false,
bodyHandler: function() {
var i = $(this).children()[0]
var imgsrc = $(i).attr('src');
return $('<img src="'+imgsrc+'" />');
}
showURL: false,
bodyHandler: function() {
var i = $(this).children()[0]
var imgsrc = $(i).attr('src');
return $('<img src="'+imgsrc+'" />');
}
});

$('input,textarea').focus( function() {
$(this).css('border-color', '#006699');
$(this).css('border-color', '#006699');
});
$('input,textarea').blur( function() {
$(this).css('border-color','#ccc');
$(this).css('border-color','#ccc');
});

// facebox popups
Expand Down

0 comments on commit bd00161

Please sign in to comment.