forked from saurabh/orbit4-5
added expanding and collapsing feature to the site structure.. collapsed by default
This commit is contained in:
parent
f5bf50ef14
commit
8c0d4f53b0
|
@ -4,6 +4,17 @@ var Items = function(){
|
|||
i.bindHandlers();
|
||||
i.itemQuantity();
|
||||
i.bindEditAddPageHandlers();
|
||||
$(".sortable").delegate(".brand, .delete", clickEvent, function(e){
|
||||
if($(this).hasClass('delete')) {
|
||||
$target = $(this);
|
||||
$('#dialog').modal('show');
|
||||
} else {
|
||||
if($(this).closest('li').children('ol').length > 0){
|
||||
$(this).closest('li').toggleClass('collapsed');
|
||||
}
|
||||
}
|
||||
e.preventDefault();
|
||||
});
|
||||
}
|
||||
|
||||
this.bindHandlers = function(){
|
||||
|
@ -41,6 +52,7 @@ var Items = function(){
|
|||
})
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
this.itemQuantity = function(){
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<% unless node.root? %>
|
||||
<li id='<%= node.id %>' class="<%= 'disabled' unless !node.enabled_for.empty? %> <%= 'no-nest' if node.class.to_s.eql?('Link') %>" >
|
||||
<li id='<%= node.id %>' class="<%= 'disabled' unless !node.enabled_for.empty? %> <%= 'collapsed' unless node.child_page.blank? %>" >
|
||||
<% end %>
|
||||
<%= render 'node', {node: node, level: level} rescue render 'admin/items/node', {node: node, level: level} %>
|
||||
<% unless node.child_page.blank? %>
|
||||
|
|
Loading…
Reference in New Issue