mirror of
https://github.com/flarum/core.git
synced 2025-10-15 17:04:26 +02:00
Use all Mithril lifecycle stubs (#2847)
This commit is contained in:
committed by
GitHub
parent
ceb567779e
commit
d4e3254395
@@ -28,7 +28,9 @@ export default class ConfirmDocumentUnload extends Component {
|
||||
$(window).on('beforeunload', this.boundHandler);
|
||||
}
|
||||
|
||||
onremove() {
|
||||
onremove(vnode) {
|
||||
super.onremove(vnode);
|
||||
|
||||
$(window).off('beforeunload', this.boundHandler);
|
||||
}
|
||||
|
||||
|
@@ -27,7 +27,9 @@ export default class Modal extends Component {
|
||||
this.attrs.animateShow(() => this.onready());
|
||||
}
|
||||
|
||||
onbeforeremove() {
|
||||
onbeforeremove(vnode) {
|
||||
super.onbeforeremove(vnode);
|
||||
|
||||
// If the global modal state currently contains a modal,
|
||||
// we've just opened up a new one, and accordingly,
|
||||
// we don't need to show a hide animation.
|
||||
|
@@ -54,7 +54,9 @@ export default class Page extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
onremove() {
|
||||
onremove(vnode) {
|
||||
super.onremove(vnode);
|
||||
|
||||
if (this.bodyClass) {
|
||||
$('#app').removeClass(this.bodyClass);
|
||||
}
|
||||
|
@@ -54,7 +54,9 @@ export default class TextEditor extends Component {
|
||||
this.attrs.composer.editor = this.buildEditor(this.$('.TextEditor-editorContainer')[0]);
|
||||
}
|
||||
|
||||
onupdate() {
|
||||
onupdate(vnode) {
|
||||
super.onupdate(vnode);
|
||||
|
||||
const newDisabled = !!this.attrs.disabled;
|
||||
|
||||
if (this.disabled !== newDisabled) {
|
||||
|
Reference in New Issue
Block a user