mirror of
https://github.com/flarum/framework.git
synced 2024-12-13 07:03:35 +08:00
Allow ActionButtons to be disabled
This commit is contained in:
parent
fab2146a31
commit
102c794a2c
|
@ -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') : '',
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user