mirror of
https://github.com/flarum/core.git
synced 2025-10-10 22:44:25 +02:00
* Replace gulp with webpack and npm scripts for JS compilation * Set up Travis CI to commit compiled JS * Restructure `js` directory; only one instance of npm, forum/admin are "submodules" * Refactor JS initializers into Application subclasses * Maintain partial compatibility API (importing from absolute paths) for extensions * Remove minification responsibility from PHP asset compiler * Restructure `less` directory
33 lines
596 B
JavaScript
33 lines
596 B
JavaScript
import Component from '../../common/Component';
|
|
|
|
/**
|
|
* The `Page` component
|
|
*
|
|
* @abstract
|
|
*/
|
|
export default class Page extends Component {
|
|
init() {
|
|
app.previous = app.current;
|
|
app.current = this;
|
|
|
|
app.modal.close();
|
|
|
|
/**
|
|
* A class name to apply to the body while the route is active.
|
|
*
|
|
* @type {String}
|
|
*/
|
|
this.bodyClass = '';
|
|
}
|
|
|
|
config(isInitialized, context) {
|
|
if (isInitialized) return;
|
|
|
|
if (this.bodyClass) {
|
|
$('#app').addClass(this.bodyClass);
|
|
|
|
context.onunload = () => $('#app').removeClass(this.bodyClass);
|
|
}
|
|
}
|
|
}
|