Allow ActionButtons to be disabled

This commit is contained in:
Toby Zerner 2015-05-27 16:21:15 +09:30
parent fab2146a31
commit 102c794a2c
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') : '',

View File

@ -38,6 +38,12 @@
text-transform: uppercase;
font-size: 12px;
font-weight: bold;
&.disabled {
cursor: default;
text-decoration: none;
opacity: 0.5;
}
}
& .btn {
margin: -10px;