Rows expanding xix
This commit is contained in:
parent
9ead0389f8
commit
c462b72235
@ -27,8 +27,9 @@
|
||||
<% end %>
|
||||
<% query.dmsf_nodes(options).each do |node| %>
|
||||
<% system = node.title =~ /^\./ %>
|
||||
<% id = (node.type == 'folder') ? "#{node.id}span" : "#{node.id}item" %>
|
||||
<% @idnt ||= 0 %>
|
||||
<tr id="<%= node.id %>span" class="<%= cycle('odd', 'even') %> <%= node.css_classes(query.deleted) %> <%= params[:classes] %> <%= @idnt > 0 ? "idnt idnt-#{@idnt}" : nil %>">
|
||||
<tr id="<%= id %>" class="<%= cycle('odd', 'even') %> <%= node.css_classes(query.deleted) %> <%= params[:classes] %> <%= @idnt > 0 ? "idnt idnt-#{@idnt}" : nil %>">
|
||||
<td class="checkbox hide-when-print">
|
||||
<%= check_box_tag('ids[]', "#{node.type}-#{node.id}", false, id: nil) unless system %>
|
||||
</td>
|
||||
|
||||
@ -129,9 +129,14 @@ function dmsfExpandRows(id, parentRow, url) {
|
||||
}
|
||||
}).done(function(data) {
|
||||
// Hide the expanding icon if there are no children
|
||||
if(data.indexOf(' ' + m[1] + ' ') < 0){
|
||||
if( m && (data.indexOf(' ' + m[1] + ' ') < 0)) {
|
||||
|
||||
$(parentRow).removeClass('dmsf-expanded');
|
||||
$(parentRow).addClass('dmsf-child');
|
||||
|
||||
if(!$(parentRow).hasClass('dmsf-child')) {
|
||||
|
||||
$(parentRow).addClass('dmsf-child');
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Add child rows
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user