mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-24 08:23:52 +00:00
Merge "ReplyWidget: Move all events bind to setup"
This commit is contained in:
commit
2b7cca1380
|
@ -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' );
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue