aglio icon indicating copy to clipboard operation
aglio copied to clipboard

Navigation auto-collapse feature

Open danielgtaylor opened this issue 10 years ago • 4 comments

This issue is to discuss the new auto-collapse feature of the Olio theme engine. It is pulled from this discussion on another issue.

@danielgtaylor wrote:

It will now attempt to close as many groups as necessary to display everything on the page. That means some groups may stay open, and the groups it chooses are determined by their height. It will try to close the smallest possible group to fit everything on the screen. If nothing can be closed to fit everything, then the largest item is closed and it tries again, until either it runs out of items or fits everything.

If you make your window smaller and refresh the page, all items will get collapsed. If people have a very large screen, then they will see some of the items. The goal is to show as much as possible based on the window size at page load time.

@robbinjanssen wrote:

That explains :) we're getting a bit offtopic here (maybe a separate issue?) but for the toggling i'd suggest that:

  • Look at the currently selected item (#resource-group-action in the URL) and toggle that one open
  • If nothing is selected and the items don't fit, toggle the first item(s) open until they no longer fit

Anybody else have any thoughts?

danielgtaylor avatar Jul 15 '15 09:07 danielgtaylor

The auto-collapse code lives here:

https://github.com/danielgtaylor/aglio/blob/olio-theme/templates/scripts.js#L97

danielgtaylor avatar Jul 15 '15 09:07 danielgtaylor

In addition, maybe introduce the following configuration options:

  • --theme-nav-collapse=no: Do not collapse menus.
  • --theme-nav-collapse=auto: Do as suggested above. (Default?)
  • --theme-nav-collapse=all: Collapse all menus.

robbinjanssen avatar Jul 16 '15 08:07 robbinjanssen

@robbinjanssen thanks, I think it does make sense to allow people to disable the feature if they want, or collapse all. This will take a bit of development work and is additive, so I'm not going to let it block the 2.0 release.

danielgtaylor avatar Jul 16 '15 08:07 danielgtaylor

@robbinjanssen's ideas are all very sensible. The current behaviour is very annoying.

OrangeDog avatar Feb 10 '17 14:02 OrangeDog