mag-component-footer

3.1.0 • Public • Published

Footer component

build status npm version dependencies status devDependencies status Gitter

Footer is a component to build user interface, an instance of Component module.

Installation

npm install mag-component-footer

Usage

Add the constructor to the scope:

var Footer = require('mag-component-footer');

Create instance with custom config:

var footer = new Footer({
    parent: page,
    data: {
        left: {
            code: keys.menu, action: function () {}
        },
        middle: [
            {
                code: 55,
                action: function () {}
            },
            {
                code: keys.f1,
                title: 'stop',
                action: function () {}
            },
            {
                code: 9000,
                className: 'customIcon',
                title: 'start',
                action: function () {}
            },
            {
                code: keys.f4,
                title: 'end',
                action: function () {}
            }
        ],
        right: {
            code: 65,
            action: function () {}
        }
    }
});

To change footer after creation:

footer.init({
    left: {
        code: keys.menu,
        action: function () {}
    },
    middle: [
        {
            code: 55,
            action: function () {}
        },
        {
            code: keys.f1, 
            title: 'stop', 
            action: function () {}
        },
        {
            code: 9000,
            className: 'customIcon',
            title: 'start',
            action: function () {}
        },
        {
            code: keys.f4, 
            title: 'end', 
            disabled: true
        }
    ],
    right: {
        code: 65, action: function () {}
    }
});

Development mode

There is a global var DEVELOP which activates additional consistency checks and protection logic not available in release mode.

Contribution

If you have any problems or suggestions please open an issue according to the contribution rules.

License

mag-component-footer is released under the MIT License.

/mag-component-footer/

    Package Sidebar

    Install

    npm i mag-component-footer

    Weekly Downloads

    3

    Version

    3.1.0

    License

    MIT

    Unpacked Size

    46.7 kB

    Total Files

    26

    Last publish

    Collaborators

    • magsdk