Building "nested" ColumnMenu's
See original GitHub issueI’m attempting to build “nested” ColumMenu
’s. What I mean by this is for example if a user selects a top level menu item “A”, the menu is replaced with “B”. If they choose “C” from B, they get another menu. This can all be unwound e.g. by pressing ESC.
This seems very similar to #150 - Update A ColumnMenu’s Items.
Currently I’m attempting to do this via multiple menus with the same dimensions and coordinates. E.g.:
// submit handler for "A"
menuB.hidden = false; // B and C start out hidden, etc.
menuB.redraw();
document.giveFocusTo(menuB);
This is of course a hack. Some things I think would help is element.show()
/ element.hide()
.
Additionally I’m running into a issue with ‘blink()’. Since this happens with a timer, “B” is drawn then “A”'s blink loop messes with it. A couple thoughts:
- For my purposes the ability to disable blink would work, though I do like the effect in general. Probably worth having some control here though.
- It may be more ideal to have submit blink -> emit ‘submit’ at the end of the blink cycle?
- Something else?!
Finally, is a nested menu system like this anywhere on the roadmap? If a single element could allow nesting and perhaps menu ident for nested items (I would use 0 indent in my case)? A x/y indent would allow for “tree” type views perhaps.
Any hints appreciated. I’d like to make myself more useful other than just asking stuff, but will need some hints on where you’re taking things in order to do any coding.
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (7 by maintainers)
@NuSkooler Added
Element#show()
andElement#hide()
on v1.47.2.@NuSkooler I ran into a similar issue 2 weeks ago with blink, so I added a
blinked
event (it’s undocumented, but it is stable).The
blinked
event passes all the argument of thesubmit
event, so it can be used as a drop-in replacement for that.EDIT: the name of the event is
blinked
notblink
.