mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-24 00:13:36 +00:00
Track events for the new comment notice
Bug: T301582 Change-Id: I40355502a59a7f31e465e52859b303680c1e109f
This commit is contained in:
parent
46d766f30d
commit
84620569dd
|
@ -943,7 +943,7 @@ ReplyWidget.prototype.updateNewCommentsWarning = function ( comments ) {
|
|||
this.newCommentsClose
|
||||
]
|
||||
} );
|
||||
this.newCommentsShow.connect( this, { click: [ 'emit', 'reloadPage' ] } );
|
||||
this.newCommentsShow.connect( this, { click: 'onNewCommentsShowClick' } );
|
||||
this.newCommentsClose.connect( this, { click: 'onNewCommentsCloseClick' } );
|
||||
this.$bodyWrapper.append( this.newCommentsWarning.$element );
|
||||
}
|
||||
|
@ -956,9 +956,24 @@ ReplyWidget.prototype.updateNewCommentsWarning = function ( comments ) {
|
|||
setTimeout( function () {
|
||||
widget.newCommentsWarning.$element.addClass( 'ext-discussiontools-ui-replyWidget-newComments-open' );
|
||||
} );
|
||||
mw.track( 'dt.schemaVisualEditorFeatureUse', {
|
||||
feature: 'notificationNewComments',
|
||||
action: 'show'
|
||||
} );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Handle click events on the new comments show button
|
||||
*/
|
||||
ReplyWidget.prototype.onNewCommentsShowClick = function () {
|
||||
this.emit( 'reloadPage' );
|
||||
mw.track( 'dt.schemaVisualEditorFeatureUse', {
|
||||
feature: 'notificationNewComments',
|
||||
action: 'page-update'
|
||||
} );
|
||||
};
|
||||
|
||||
/**
|
||||
* Handle click events on the new comments close button
|
||||
*/
|
||||
|
@ -967,6 +982,10 @@ ReplyWidget.prototype.onNewCommentsCloseClick = function () {
|
|||
// Hide the warning for the rest of the lifetime of the widget
|
||||
this.hideNewCommentsWarning = true;
|
||||
this.focus();
|
||||
mw.track( 'dt.schemaVisualEditorFeatureUse', {
|
||||
feature: 'notificationNewComments',
|
||||
action: 'close'
|
||||
} );
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue