2.0.2 • Published 4 years ago

jean-button v2.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

Description

Basic button functionality

Support

AMD eco system. If there is no loader, Button is registered as a browser variable.

Code Example

  • Use it as browser variable
 var button = new Button({
    id: "test-btn",
    name: "i am a button",
    isHighlightable: true,
    isHighlighted: true,
    onButtonClick: function (id, state) {
        console.log(id + " clicked with state: " + state);
    }
});
document.body.appendChild(button.element);
  • Use it with require.js
require(["path/to/Button"], function(Button){
    // Work with Button
});

Installation

npm install jean-button --save --legacy-bundling

API Reference

Options

  • id: String - mandatory - id of the button
  • name: String - mandatory - name of the button
  • isHighlightable: Boolean - optional - True if button stays highlighted after a click, false otherwise
  • isHighlighted: Boolean - optional - True if button stays highlighted after a click, false otherwise
  • onButtonClick: Function - optional - Gets called, if button is clicked

Tests

  • Open spec/spec-runner.html in browser to see the test cases.
  • Host example/index.html and display it in your browser

License

MIT

2.0.2

4 years ago

2.0.1

4 years ago

1.0.4

4 years ago

2.0.0

4 years ago

1.0.3

4 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago