mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-28 08:50:07 +00:00
Tracking for change events in citation-templates
Bug: T221305 Change-Id: I4aa099ae1f7a6a2bb49b28c6d1452d077ffa61b7
This commit is contained in:
parent
797b80748d
commit
ba9b0c280b
|
@ -85,6 +85,8 @@ ve.ui.MWCitationDialog.prototype.initialize = function ( data ) {
|
|||
|
||||
// HACK: Use the same styling as single-mode transclusion dialog - this should be generalized
|
||||
this.$content.addClass( 've-ui-mwTransclusionDialog-single' );
|
||||
|
||||
this.$content.on( 'change', this.onInputChange.bind( this ) );
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -97,6 +99,8 @@ ve.ui.MWCitationDialog.prototype.getSetupProcess = function ( data ) {
|
|||
this.inDialog = data.inDialog;
|
||||
this.citationTemplate = data.template;
|
||||
this.citationTitle = data.title;
|
||||
|
||||
this.trackedCitationInputChange = false;
|
||||
}, this )
|
||||
.next( function () {
|
||||
this.updateTitle();
|
||||
|
@ -245,6 +249,18 @@ ve.ui.MWCitationDialog.prototype.getTeardownProcess = function ( data ) {
|
|||
}, this );
|
||||
};
|
||||
|
||||
/**
|
||||
* Handle change events on the transclusion inputs
|
||||
*
|
||||
* @param {jQuery.Event} ev The browser event
|
||||
*/
|
||||
ve.ui.MWCitationDialog.prototype.onInputChange = function () {
|
||||
if ( !this.trackedCitationInputChange ) {
|
||||
ve.track( 'activity.' + this.constructor.static.name, { action: 'manual-template-input' } );
|
||||
this.trackedCitationInputChange = true;
|
||||
}
|
||||
};
|
||||
|
||||
/* Registration */
|
||||
|
||||
ve.ui.windowFactory.register( ve.ui.MWCitationDialog );
|
||||
|
|
Loading…
Reference in a new issue