Merge "ReplyWidget: Move all events bind to setup"

This commit is contained in:
jenkins-bot 2020-05-18 19:19:47 +00:00 committed by Gerrit Code Review
commit 2b7cca1380
2 changed files with 9 additions and 9 deletions

View file

@ -12,9 +12,6 @@ function ReplyWidgetPlain() {
// Parent constructor
ReplyWidgetPlain.super.apply( this, arguments );
// Events
this.replyBodyWidget.connect( this, { change: this.onInputChangeThrottled } );
this.$element.addClass( 'dt-ui-replyWidget-plain' );
}
@ -82,12 +79,15 @@ ReplyWidgetPlain.prototype.setup = function () {
// Parent method
ReplyWidgetPlain.super.prototype.setup.call( this );
// Events
this.replyBodyWidget.connect( this, { change: this.onInputChangeThrottled } );
this.replyBodyWidget.once( 'change', this.onFirstTransaction.bind( this ) );
return this;
};
ReplyWidgetPlain.prototype.teardown = function () {
this.replyBodyWidget.disconnect( this );
this.replyBodyWidget.off( 'change' );
this.storage.remove( this.storagePrefix + '/class' );

View file

@ -20,12 +20,6 @@ function ReplyWidgetVisual() {
this.defaultMode = 'visual';
this.initialValue = null;
// Events
this.replyBodyWidget.connect( this, {
change: 'onInputChangeThrottled',
submit: 'onReplyClick'
} );
// TODO: Rename this widget to VE, as it isn't just visual mode
this.$element.addClass( 'dt-ui-replyWidget-ve' );
}
@ -90,12 +84,18 @@ ReplyWidgetVisual.prototype.setup = function () {
// Parent method
ReplyWidgetVisual.super.prototype.setup.call( this );
// Events
this.replyBodyWidget.connect( this, {
change: 'onInputChangeThrottled',
submit: 'onReplyClick'
} );
this.replyBodyWidget.once( 'change', this.onFirstTransaction.bind( this ) );
return this;
};
ReplyWidgetVisual.prototype.teardown = function () {
this.replyBodyWidget.disconnect( this );
this.replyBodyWidget.off( 'change' );
// Parent method