mirror of
https://github.com/flarum/framework.git
synced 2025-05-29 19:49:36 +08:00
Allow ActionButtons to be disabled
This commit is contained in:
@ -12,6 +12,12 @@ export default class ActionButton extends Component {
|
|||||||
var label = attrs.label;
|
var label = attrs.label;
|
||||||
delete attrs.label;
|
delete attrs.label;
|
||||||
|
|
||||||
|
if (attrs.disabled) {
|
||||||
|
attrs.className = (attrs.className || '')+' disabled';
|
||||||
|
delete attrs.onclick;
|
||||||
|
delete attrs.disabled;
|
||||||
|
}
|
||||||
|
|
||||||
attrs.href = attrs.href || 'javascript:;';
|
attrs.href = attrs.href || 'javascript:;';
|
||||||
return m('a'+(iconName ? '.has-icon' : ''), attrs, [
|
return m('a'+(iconName ? '.has-icon' : ''), attrs, [
|
||||||
iconName ? icon(iconName+' icon') : '',
|
iconName ? icon(iconName+' icon') : '',
|
||||||
|
@ -38,6 +38,12 @@
|
|||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
|
||||||
|
&.disabled {
|
||||||
|
cursor: default;
|
||||||
|
text-decoration: none;
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
& .btn {
|
& .btn {
|
||||||
margin: -10px;
|
margin: -10px;
|
||||||
|
Reference in New Issue
Block a user