cloudcmd/modules/menu
2016-02-05 14:15:53 -05:00
..
example feature(modules) add 2015-03-28 09:16:49 -04:00
.bower.json feature(bower) menu v1.0.1 2016-02-05 14:15:53 -05:00
bower.json feature(bower) menu v1.0.1 2016-02-05 14:15:53 -05:00
ChangeLog feature(bower) menu v1.0.1 2016-02-05 14:15:53 -05:00
LICENSE feature(modules) add 2015-03-28 09:16:49 -04:00
menu-io.css feature(modules) add 2015-03-28 09:16:49 -04:00
menu-io.js feature(bower) menu v1.0.1 2016-02-05 14:15:53 -05:00
menu-io.min.css feature(modules) add 2015-03-28 09:16:49 -04:00
menu-io.min.js feature(bower) menu v1.0.1 2016-02-05 14:15:53 -05:00
package.json feature(bower) menu v1.0.1 2016-02-05 14:15:53 -05:00
README.md feature(bower) menu v1.0.0 2016-02-05 06:59:06 -05:00

Menu Build Status

Simple css-based context menu made for Cloud Commander.

Little bit better then other people do :). So to see at work look here.

#How come?

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

#Why should I care?

  • 1.6kb min & gzip for js.
  • 1kb min & gzip for css.
  • no dependencies.
  • easy to use.
  • easy to extend.

Install

With help of bower.

bower install menu

#How use? Create html page with js and css connected.

<link rel="stylesheet" href="http://coderaiser.github.io/menu-io/menu.min.css">
<script src="http://coderaiser.github.io/menu-io/menu.min.js"></script>

Add little JavaScript:

var menu        = MenuIO({
    'item name': function onItemNameClick() {
    }
}

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

var element     = document.body,
    
    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 */
    },
    
    menu        = MenuIO(element, options, {
        'item name': function onItemNameClick() {
    });

Look for examples directory or copy example from bottom:

<link rel="stylesheet" href="http://coderaiser.github.io/menu-io/menu.min.css">
<script src="http://coderaiser.github.io/menu-io/menu-io.min.js"></script>
<script>
    window.addEventListener('load', function onLoad() {
        'use strict';
        
        window.removeEventListener('load', onLoad);
        var menu        = MenuIO({
            help: function() {
                alert('*help');
            },
            upload: {
                github: {
                    gist: function() {
                        alert('*gist');
                    },
                    main: function() {
                        alert('*main');
                    }
                },
                dropbox: function() {
                    alert('*dropbox');
                }
            }
        });
    });
</script>

#License MIT