Logic Machine Forum
Sidebar Subfolders Expand/Collapse Items Option - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Visualization (https://forum.logicmachine.net/forumdisplay.php?fid=9)
+--- Thread: Sidebar Subfolders Expand/Collapse Items Option (/showthread.php?tid=1596)



Sidebar Subfolders Expand/Collapse Items Option - manos@dynamitec - 17.09.2018

Dear All,

I am having a large project with 60+ rooms to visualize which will be grouped by floor and I would like to avoid a long scrolling list on the sidebar. I like the docked sidebar and the function when clicking on the right side (arrow) of the Folder Title a new tab will open showing only the items contained in the particular subfolder but I would like to ask how could I create a custom function by clicking on the Subfolder title to toggle between Expand and Collapse of the items that are under it. Please see the attached photo.

Thank you in advance.

Best regards


RE: Sidebar Subfolders Expand/Collapse Items Option - Daniel - 17.09.2018

No photo Smile


RE: Sidebar Subfolders Expand/Collapse Items Option - manos@dynamitec - 17.09.2018

(17.09.2018, 09:26)Daniel. Wrote: No photo Smile

Hello Daniel.

Thank you for your indication.

Updated! Forgot to click on the Add Attachment button  Rolleyes

Regards,


RE: Sidebar Subfolders Expand/Collapse Items Option - admin - 17.09.2018

Try this Custom JavaScript. All sub-menus will be in collapsed state by default, apart from the menu with currently selected plan. This menu cannot be collapsed.
Code:
$(function() {
  var items = $('.nav li');
  
  $('.level').on('vclick', function() {
    var li = $(this), sub = [];
    
    while (true) {
      li = li.next();
      if (!li.length || li.hasClass('level')) {
        break;
      }
      
      if (li.hasClass('active')) {
        return;
      }
      
      sub.push(li);
    }
    
    $.each(sub, function(_, li) {
      li.toggleClass('hide');
    });
  }).trigger('vclick');
});



RE: Sidebar Subfolders Expand/Collapse Items Option - manos@dynamitec - 17.09.2018

(17.09.2018, 09:47)admin Wrote: Try this Custom JavaScript. All sub-menus will be in collapsed state by default, apart from the menu with currently selected plan. This menu cannot be collapsed.
Code:
$(function() {
 var items = $('.nav li');
 
 $('.level').on('vclick', function() {
   var li = $(this), sub = [];
   
   while (true) {
     li = li.next();
     if (!li.length || li.hasClass('level')) {
       break;
     }
     
     if (li.hasClass('active')) {
       return;
     }
     
     sub.push(li);
   }
   
   $.each(sub, function(_, li) {
     li.toggleClass('hide');
   });
 }).trigger('vclick');
});

Works Great! Thank you very much.  Shy