1
0
mirror of https://github.com/flarum/core.git synced 2025-08-08 17:36:38 +02:00

Don't accept unnecessary vnode argument where it isn't used

This commit is contained in:
Alexander Skvortsov
2020-08-15 19:12:14 -04:00
committed by Franz Liedke
parent 3764abee51
commit 4b05e0073a
11 changed files with 14 additions and 14 deletions

View File

@@ -27,7 +27,7 @@ export default class ConfirmDocumentUnload extends Component {
$(window).on('beforeunload', this.handler.bind(this)); $(window).on('beforeunload', this.handler.bind(this));
} }
onremove(vnode) { onremove() {
$(window).off('beforeunload', this.handler.bind(this)); $(window).off('beforeunload', this.handler.bind(this));
} }

View File

@@ -16,7 +16,7 @@ export default class ModalManager extends Component {
); );
} }
onupdate(vnode) { onupdate() {
if (this.$('Modal') && !this.attrs.state.modal) { if (this.$('Modal') && !this.attrs.state.modal) {
this.animateHide(); this.animateHide();
} }

View File

@@ -53,8 +53,8 @@ export default class CommentPost extends Post {
]); ]);
} }
onupdate(vnode) { onupdate() {
super.onupdate(vnode); super.onupdate();
const contentHtml = this.isEditing() ? '' : this.attrs.post.contentHtml(); const contentHtml = this.isEditing() ? '' : this.attrs.post.contentHtml();

View File

@@ -27,7 +27,7 @@ export default class CommentPostPreview extends Component {
this.updateInterval = setInterval(updatePreview, 50); this.updateInterval = setInterval(updatePreview, 50);
} }
onremove(vnode) { onremove() {
clearInterval(this.updateInterval); clearInterval(this.updateInterval);
} }
} }

View File

@@ -41,7 +41,7 @@ export default class DiscussionListPane extends Component {
} }
} }
onremove(vnode) { onremove() {
$(document).off('mousemove', hotEdge); $(document).off('mousemove', hotEdge);
} }
} }

View File

@@ -51,7 +51,7 @@ export default class DiscussionPage extends Page {
this.prevRoute = m.route.get(); this.prevRoute = m.route.get();
} }
onremove(vnode) { onremove() {
// If we are indeed navigating away from this discussion, then disable the // If we are indeed navigating away from this discussion, then disable the
// discussion list pane. Also, if we're composing a reply to this // discussion list pane. Also, if we're composing a reply to this
// discussion, minimize the composer unless it's empty, in which case // discussion, minimize the composer unless it's empty, in which case

View File

@@ -125,8 +125,8 @@ export default class IndexPage extends Page {
} }
} }
onremove(vnode) { onremove() {
super.onremove(vnode); super.onremove();
$('#app').css('min-height', ''); $('#app').css('min-height', '');

View File

@@ -84,7 +84,7 @@ export default class Post extends Component {
return this.subtree.needsRebuild(); return this.subtree.needsRebuild();
} }
onupdate(vnode) { onupdate() {
const $actions = this.$('.Post-actions'); const $actions = this.$('.Post-actions');
const $controls = this.$('.Post-controls'); const $controls = this.$('.Post-controls');

View File

@@ -34,7 +34,7 @@ export default class PostEdited extends Component {
); );
} }
onupdate(vnode) { onupdate() {
if (this.shouldUpdateTooltip) { if (this.shouldUpdateTooltip) {
this.$().tooltip('destroy').tooltip(); this.$().tooltip('destroy').tooltip();
this.shouldUpdateTooltip = false; this.shouldUpdateTooltip = false;

View File

@@ -104,7 +104,7 @@ export default class PostStream extends Component {
return <div className="PostStream">{items}</div>; return <div className="PostStream">{items}</div>;
} }
onupdate(vnode) { onupdate() {
this.triggerScroll(); this.triggerScroll();
} }
@@ -118,7 +118,7 @@ export default class PostStream extends Component {
setTimeout(() => this.scrollListener.start()); setTimeout(() => this.scrollListener.start());
} }
onremove(vnode) { onremove() {
this.scrollListener.stop(); this.scrollListener.stop();
clearTimeout(this.calculatePositionTimeout); clearTimeout(this.calculatePositionTimeout);
} }

View File

@@ -34,7 +34,7 @@ export default class ReplyPlaceholderPreview extends Component {
}, 50); }, 50);
} }
onremove(vnode) { onremove() {
clearInterval(this.updateInterval); clearInterval(this.updateInterval);
} }
} }