mirror of
https://github.com/flarum/framework.git
synced 2024-11-29 04:33:47 +08:00
a9ded36b57
- Get rid of Bootstrap (except we still rely on some JS) - Use BEM class names - Rework variables/theme config - Fix various bugs, including some on mobile The CSS is still not ideal – it needs to be cleaned up some more. But that can be a focus for after beta.
28 lines
715 B
JavaScript
28 lines
715 B
JavaScript
import Component from 'flarum/Component';
|
|
|
|
/**
|
|
* The `LoadingIndicator` component displays a loading spinner with spin.js. It
|
|
* may have the following special props:
|
|
*
|
|
* - `size` The spin.js size preset to use. Defaults to 'small'.
|
|
*
|
|
* All other props will be assigned as attributes on the element.
|
|
*/
|
|
export default class LoadingIndicator extends Component {
|
|
view() {
|
|
const attrs = Object.assign({}, this.props);
|
|
|
|
attrs.className = 'LoadingIndicator ' + (attrs.className || '');
|
|
delete attrs.size;
|
|
|
|
return <div {...attrs}>{m.trust(' ')}</div>;
|
|
}
|
|
|
|
config() {
|
|
const size = this.props.size || 'small';
|
|
|
|
$.fn.spin.presets[size].zIndex = 'auto';
|
|
this.$().spin(size);
|
|
}
|
|
}
|