Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaScript collection helpers/plugins #1868

Open
jamessampford opened this issue Feb 7, 2021 · 0 comments
Open

JavaScript collection helpers/plugins #1868

jamessampford opened this issue Feb 7, 2021 · 0 comments
Labels
type/feat Any feature requests or improvements

Comments

@jamessampford
Copy link
Contributor

I was putting together something for #1501 to help with overflowing horizontal tabular menus (since they are not great when they overflow on a narrow screen). Though menu does not currently have a JavaScript module to extend, so throwing this in here to see if/how we could implement this kind of functionality since I do not think it can be done purely with CSS

Demo:
https://jsfiddle.net/awcn96p0/

Essentially this could add a new .menu() module which could be applied to a menu to allow a menu to allow JavaScript to set the overflow method to none, auto, dropdown, and scroll

  • None is essentially the current setup (too many goes offscreen)
  • Dropdown does some calculations and if the tab will end up overflowing, will hide them, and add them to a dropdown
  • Scroll essentially will allow you to scroll through them with touch (similar way to Github when viewing on mobile)
  • Auto is a combination of dropdown and scroll, if the device is touch, then you get scroll, otherwise have dropdown

The slightly troublesome thing is I do not know if this should be a module (one function seems a little silly), and there are probably other examples of things that could potentially be added in where JavaScript makes a bit more sense to provide the functionality

Which made me think should there be some kind of standard way of perhaps making a plugin system which could make these kinds of things available and ensuring that other modules have been included if they need them when they run?

So this could possibly instead look like .plugin('pluginname', {plugin: settings}) where plugin does all the loading of modules, and providing all the base functionality (like debugging)

@jamessampford jamessampford added state/awaiting-triage Any issues or pull requests which haven't yet been triaged type/feat Any feature requests or improvements labels Feb 7, 2021
@lubber-de lubber-de removed the state/awaiting-triage Any issues or pull requests which haven't yet been triaged label Feb 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feat Any feature requests or improvements
Projects
None yet
Development

No branches or pull requests

2 participants