Complete modal now hides nicely when all help-boxes are hidden

This commit is contained in:
Philipp Bayer
2012-08-19 14:28:21 +10:00
parent 2d3241a94a
commit 06a88ff556
2 changed files with 55 additions and 42 deletions

View File

@@ -15,42 +15,41 @@
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<h3><%= link_to("openSNP", root_path, :class =>"brand") %></h3>
<div class="nav-collapse">
<ul class="nav">
<li><%= link_to("News", '/news') %></li>
<li><%= link_to("Genotypes", :controller => "genotypes", :action => "index")%>
<li><%= link_to("Phenotypes", :controller => "phenotypes", :action => "index")%>
<li><%= link_to("SNPs", :controller => "snps", :action => "index") %></li>
<li><%= link_to("Users", '/user_index') %></li>
</ul>
<%= form_tag "/search", :method => "get",:class => "navbar-search pull-left", :authenticity_token => true do %>
<%= text_field_tag :search, nil, :placeholder => "Search here", :class => "search-query" %>
<% end %>
<ul class="nav secondary-nav pull-right">
<% if current_user %>
<li class="dropdown">
<a href="#" class="dropdown-toggle"><%= image_tag current_user.avatar.url(:head),:style => "vertical-align:middle"%> <%= current_user.name %><b class="caret"></b></a>
<ul class="dropdown-menu">
<li><%= link_to("Settings", :controller => "users", :action => "edit",:id => current_user) %></li>
<li><%= link_to("Edit Your Phenotypes", "/users/"+current_user.id.to_s+"/edit#phenotypes")%>
<li class="divider"></li>
<li><%= link_to("Messages ("+current_user.messages.where(:user_has_seen => false).length.to_s+")","/users/" + current_user.id.to_s + "#messages")%>
<li class="divider"></li>
<li><%= link_to("Sign out", '/signout') %></li>
</ul>
</li>
<% else %>
<li><%= link_to("Sign in", '/signin') %></li>
<% end %>
<li><%= link_to("FAQ", '/faq') %></li>
</ul>
</div>
</div>
</div>
<div class="navbar-inner">
<div class="container">
<h3><%= link_to("openSNP", root_path, :class =>"brand") %></h3>
<div class="nav-collapse">
<ul class="nav">
<li><%= link_to("News", '/news') %></li>
<li><%= link_to("Genotypes", :controller => "genotypes", :action => "index")%>
<li><%= link_to("Phenotypes", :controller => "phenotypes", :action => "index")%>
<li><%= link_to("SNPs", :controller => "snps", :action => "index") %></li>
<li><%= link_to("Users", '/user_index') %></li>
</ul>
<%= form_tag "/search", :method => "get",:class => "navbar-search pull-left", :authenticity_token => true do %>
<%= text_field_tag :search, nil, :placeholder => "Search here", :class => "search-query" %>
<% end %>
<ul class="nav secondary-nav pull-right">
<% if current_user %>
<li class="dropdown">
<a href="#" class="dropdown-toggle"><%= image_tag current_user.avatar.url(:head),:style => "vertical-align:middle"%> <%= current_user.name %><b class="caret"></b></a>
<ul class="dropdown-menu">
<li><%= link_to("Settings", :controller => "users", :action => "edit",:id => current_user) %></li>
<li><%= link_to("Edit Your Phenotypes", "/users/"+current_user.id.to_s+"/edit#phenotypes")%>
<li class="divider"></li>
<li><%= link_to("Messages ("+current_user.messages.where(:user_has_seen => false).length.to_s+")","/users/" + current_user.id.to_s + "#messages")%>
<li class="divider"></li>
<li><%= link_to("Sign out", '/signout') %></li>
</ul>
</li>
<% else %>
<li><%= link_to("Sign in", '/signin') %></li>
<% end %>
<li><%= link_to("FAQ", '/faq') %></li>
</ul>
</div>
</div>
</div>
</div>
<div class="container" id="help_block">
<%if current_user %>

View File

@@ -1,9 +1,7 @@
// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
$(document).ready(function()
{
$(document).ready(function() {
$('#update_user').click(function() {
$('#update_user').val("Updating...").addClass("disabled");
setTimeout(function(){ $('#update_user').val("Update Information").removeClass("disabled");},1000);
@@ -11,14 +9,30 @@ $(document).ready(function()
$("#PaperMendeley").tablesorter({sortList: [[2,1]]});
$("#PaperPlos").tablesorter({sortList: [[2,1]]});
$('#remove_help_one').click(function() {
$('#help_one').hide('slow');
if( $('#help_three').is(":hidden") && $('#help_two').is(":hidden") ){
$("#help_block").hide("slow");
}
else {
$('#help_one').hide('slow');
}
});$
$('#remove_help_two').click(function() {
$('#help_two').hide('slow');
if( $('#help_one').is(":hidden") && $('#help_three').is(":hidden") ){
$("#help_block").hide("slow");
}
else {
$('#help_two').hide('slow');
}
});
$('#remove_help_three').click(function() {
$('#help_three').hide('slow');
if( $('#help_one').is(":hidden") && $('#help_two').is(":hidden") ){
$("#help_block").hide("slow");
}
else {
$('#help_three').hide('slow');
};
});
$('#tab-container').easytabs();