-
Notifications
You must be signed in to change notification settings - Fork 18
/
button.js
49 lines (46 loc) · 1019 Bytes
/
button.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/**
* @module "montage/ui/button.reel"
*/
var AbstractButton = require("montage/ui/base/abstract-button").AbstractButton;
/**
* ![Button](https://raw.github.com/montagejs/digit/master/ui/button.reel/screenshot.png)
*
* The Button component wraps a <button> or <input type="button"> element.
*
* ### How to use
*
* ```json
* "button": {
* "prototype": "digit/ui/button.reel",
* "properties": {
* "element": {"#": "button"}
* }
* }
* ```
*
* ```html
* <button data-montage-id="button">Button</button>
* ```
*
* ### Customizing with CSS
*
* * `.digit-Button` - The Button element
*
* ```css
* .digit-Button {
* background-color: pink;
* }
* ```
* @class Button
* @extends external:AbstractButton
* @classdesc
*/
exports.Button = AbstractButton.specialize( /** @lends Button# */ {
hasTemplate: {value: true},
constructor : {
value: function Button() {
this.super();
this.classList.add("digit-Button");
}
}
});