Rewrite of navigation controller to reduce re-render counter.
This commit is contained in:
parent
561570834f
commit
a2aa99e9fd
2 changed files with 40 additions and 0 deletions
20
app/assets/javascripts/app/views/navigation/menu.jst.eco
Normal file
20
app/assets/javascripts/app/views/navigation/menu.jst.eco
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
<% for item in @items: %>
|
||||||
|
<% if item.child: %>
|
||||||
|
<li class="dropdown <% if @open_tab[item.target] : %>open<% end %>">
|
||||||
|
<a href="<%= item.target %>" class="dropdown-toggle" data-toggle="dropdown"><%- @T( item.name ) %> <b class="caret"></b></a>
|
||||||
|
<ul class="dropdown-menu">
|
||||||
|
<% for item in item.child: %>
|
||||||
|
<% if item.divider: %>
|
||||||
|
<li class="divider"></li>
|
||||||
|
<% end %>
|
||||||
|
<% if item.navheader: %>
|
||||||
|
<li class="dropdown-header"><%- @T( item.navheader ) %></li>
|
||||||
|
<% end %>
|
||||||
|
<li class="<% if @active_tab[item.target] : %>active<% end %>"><a href="<%= item.target %>"><%- @T( item.name ) %><% if item['count'] isnt undefined: %><span class="badge count"><%= item['count'] %></span><% end %></a></li>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<% else: %>
|
||||||
|
<li class="<% if @active_tab[item.target] : %>active<% end %>"><a href="<%= item.target %>"><%- @T( item.name ) %></a></li>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
20
app/assets/javascripts/app/views/navigation/private.jst.eco
Normal file
20
app/assets/javascripts/app/views/navigation/private.jst.eco
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
<% for item in @items: %>
|
||||||
|
<% if item.child: %>
|
||||||
|
<li class="dropdown <% if @open_tab[item.target] : %>open<% end %> navbar-private">
|
||||||
|
<a href="<%= item.target %>" class="dropdown-toggle" data-toggle="dropdown"><%- @T( item.name ) %> <b class="caret"></b></a>
|
||||||
|
<ul class="dropdown-menu">
|
||||||
|
<% for item in item.child: %>
|
||||||
|
<% if item.divider: %>
|
||||||
|
<li class="divider"></li>
|
||||||
|
<% end %>
|
||||||
|
<% if item.navheader: %>
|
||||||
|
<li class="dropdown-header"><%- @T( item.navheader ) %></li>
|
||||||
|
<% end %>
|
||||||
|
<li class="<% if @active_tab[item.target] : %>active<% end %>"><a href="<%= item.target %>"><%- @T( item.name ) %><% if item['count'] isnt undefined: %><span class="badge count"><%= item['count'] %>)</span><% end %></a></li>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<% else: %>
|
||||||
|
<li class="<% if @active_tab[item.target] : %>active<% end %>"><a href="<%= item.target %>"><%- @T( item.name ) %></a></li>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
Loading…
Reference in a new issue