salix/client/core/src/components/button/button.js

29 lines
672 B
JavaScript
Raw Normal View History

2018-02-10 15:18:01 +00:00
import ngModule from '../../module';
import Input from '../../lib/input';
import './style.scss';
2018-02-10 15:18:01 +00:00
export default class Button extends Input {
constructor($element) {
super($element);
this.$element = $element;
this.input = this.element.querySelector('.mdl-button');
$element[0].addEventListener('click', event => {
if (this.disabled)
event.stopImmediatePropagation();
});
}
2018-02-10 15:18:01 +00:00
}
Button.$inject = ['$element'];
ngModule.component('vnButton', {
controller: Button,
template: require('./button.html'),
bindings: {
label: '@?',
disabled: '<?',
icon: '@?'
}
});