Simple css-based multillevel context menu
JavaScript CSS HTML
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
css
example
lib
.babelrc
.eslintrc
.gitignore
.npmignore
.stylelintrc.yml
.travis.yml
ChangeLog
LICENSE
README.md
package.json
webpack.config.js

README.md

Supermenu Build Status

Simple css-based context menu made for Cloud Commander.

Little bit better then other people do :).

How come?

Tired to use js based libraries which use jquery and .hover classes insteed of :hover pseudo-selectors.

Install

npm i supermenu

How use?

Add little JavaScript:

const supermenu = require('supermenu');
const menu = supermenu({
    'item name': () => {
    }
}

You could use element and (or) options parameters if you need to.

const element = document.body;

const options = {
    icon        : true, /* add class icon-item-name */
    beforeClose : alert,
    beforeShow  : alert,
    beforeClick : alert,
    name        : 'name of menu' /* if you want use a couple menu on one element */
};

const menu = supermenu(element, options, {
    'item name': () => {
});

Look for examples directory or copy example from bottom:

const menu = supermenu({
    help: function() {
        alert('*help');
    },
    upload: {
        github: {
            gist: function() {
                alert('*gist');
            },
            main: function() {
                alert('*main');
            }
        },
        dropbox: function() {
            alert('*dropbox');
        }
    }
});

License

MIT