Allow ActionButtons to be disabled

This commit is contained in:
Toby Zerner
2015-05-27 16:21:15 +09:30
parent c5d820a92d
commit 6fed357605
2 changed files with 12 additions and 0 deletions

View File

@ -12,6 +12,12 @@ export default class ActionButton extends Component {
var label = attrs.label;
delete attrs.label;
if (attrs.disabled) {
attrs.className = (attrs.className || '')+' disabled';
delete attrs.onclick;
delete attrs.disabled;
}
attrs.href = attrs.href || 'javascript:;';
return m('a'+(iconName ? '.has-icon' : ''), attrs, [
iconName ? icon(iconName+' icon') : '',