Render collapse/expand buttons using CSS instead of JS

Fix #1354
Also clean up some dependent JS unused since c64e1bc
This commit is contained in:
Dan Rice 2012-11-14 22:01:43 -05:00
parent 416a8699d5
commit bdbb1dd29d
11 changed files with 18 additions and 53 deletions

View file

@ -7,7 +7,7 @@ cache [context, @source_view, current_user.date.strftime("%Y%m%d")] do
<div id="c<%= context.id %>" class="container context" style="display:<%= (collapsible && @not_done.empty?) ? "none" : "block" %>">
<h2>
<% if collapsible -%>
<a href="#" class="container_toggle" id="toggle_c<%= context.id %>"><%= image_tag("collapse.png") %></a>
<a href="#" class="container_toggle" id="toggle_c<%= context.id %>"><%= image_tag("blank.png", :alt => t('common.collapse_expand')) %></a>
<% end -%>
<% if source_view_is :context %>
<span id="context_name"><%= context.name %></span>
@ -23,4 +23,4 @@ cache [context, @source_view, current_user.date.strftime("%Y%m%d")] do
<%= render :partial => "todos/todo", :collection => @not_done, :locals => { :parent_container_type => "context" } %>
</div>
</div>
<% end %>
<% end %>

View file

@ -5,7 +5,7 @@ cache [project, current_user.date.strftime("%Y%m%d")] do %>
<div class="container">
<h2 id="project_name_container">
<% if collapsible -%>
<a href="#" class="container_toggle" id="toggle_p<%= project.id %>"><%= image_tag("collapse.png") %></a>
<a href="#" class="container_toggle" id="toggle_p<%= project.id %>"><%= image_tag("blank.png", :alt => t('common.collapse_expand')) %></a>
<% end -%>
<div id="project_name" style="width: 100%;"><%= project.name -%></div>
</h2>
@ -23,4 +23,4 @@ cache [project, current_user.date.strftime("%Y%m%d")] do %>
<%= render :partial => "todos/todo", :collection => @not_done, :locals => { :parent_container_type => "project" } %>
</div>
</div>
<% end %>
<% end %>

View file

@ -6,7 +6,7 @@
<div class=add_note_link><%= link_to t('common.show_all'), determine_done_path%></div>
<h2>
<% if collapsible %>
<a href="#" class="container_toggle" id="toggle_completed"><%= image_tag("collapse.png") %></a>
<a href="#" class="container_toggle" id="toggle_completed"><%= image_tag("blank.png", :alt => t('common.collapse_expand')) %></a>
<% end %>
<%= t('todos.completed_actions') %> <%= raw suffix %>
</h2>
@ -18,4 +18,4 @@
<%= render :partial => "todos/todo", :collection => completed, :locals => { :parent_container_type => "completed", :suppress_context => suppress_context, :suppress_project => suppress_project } %>
</div>
</div>
</div>

View file

@ -1,7 +1,7 @@
<div class="container tickler" id="tickler">
<h2>
<% if collapsible %>
<a href="#" class="container_toggle" id="toggle_deferred"><%= image_tag("collapse.png") %></a>
<a href="#" class="container_toggle" id="toggle_deferred"><%= image_tag("blank.png", :alt => t('common.collapse_expand')) %></a>
<% end %>
<%= t('todos.deferred_pending_actions') %> <%= raw(append_descriptor ? append_descriptor : '') %>
</h2>

View file

@ -1,7 +1,7 @@
<div class="container hidden" id="hidden">
<h2>
<% if collapsible %>
<a href="#" class="container_toggle" id="toggle_deferred"><%= image_tag("collapse.png") %></a>
<a href="#" class="container_toggle" id="toggle_deferred"><%= image_tag("blank.png", :alt => t('common.collapse_expand')) %></a>
<% end %>
<%= t('todos.hidden_actions') %> <%= raw(append_descriptor ? append_descriptor : '') %>
</h2>
@ -14,4 +14,4 @@
<%= render :partial => "todos/todo", :collection => hidden, :locals => { :parent_container_type => 'tag' } %>
</div><!-- [end:items] -->
</div><!-- [end:tickler] -->
</div><!-- [end:tickler] -->