mirror of
https://github.com/flarum/framework.git
synced 2025-06-01 21:13:24 +08:00
Improve extensions page
- Allow extensions to define an icon in their flarum.json - Show a "please wait" modal when enabling/disabling an extension - Styling tweaks
This commit is contained in:
@ -28,13 +28,15 @@ export default class Modal extends Component {
|
||||
return (
|
||||
<div className={'Modal modal-dialog ' + this.className()}>
|
||||
<div className="Modal-content">
|
||||
<div className="Modal-close App-backControl">
|
||||
{Button.component({
|
||||
icon: 'times',
|
||||
onclick: this.hide.bind(this),
|
||||
className: 'Button Button--icon Button--link'
|
||||
})}
|
||||
</div>
|
||||
{this.isDismissible() ? (
|
||||
<div className="Modal-close App-backControl">
|
||||
{Button.component({
|
||||
icon: 'times',
|
||||
onclick: this.hide.bind(this),
|
||||
className: 'Button Button--icon Button--link'
|
||||
})}
|
||||
</div>
|
||||
) : ''}
|
||||
|
||||
<form onsubmit={this.onsubmit.bind(this)}>
|
||||
<div className="Modal-header">
|
||||
@ -50,6 +52,15 @@ export default class Modal extends Component {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether or not the modal should be dismissible via an 'x' button.
|
||||
*
|
||||
* @return {Boolean}
|
||||
*/
|
||||
isDismissible() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the class name to apply to the modal.
|
||||
*
|
||||
|
@ -50,7 +50,7 @@ export default class ModalManager extends Component {
|
||||
|
||||
m.redraw(true);
|
||||
|
||||
this.$().modal('show');
|
||||
this.$().modal({backdrop: this.component.isDismissible() ? true : 'static'}).modal('show');
|
||||
this.onready();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user