Analytics: track more things for Growth

Bug: T207802
Change-Id: I77652325ce7b9dda9c4f4a86c1d34421451cf025
This commit is contained in:
David Lynch 2018-10-24 12:18:21 -05:00
parent ad3fc3c12d
commit 803f476528
2 changed files with 18 additions and 0 deletions

View file

@ -82,6 +82,8 @@ ve.ui.MWEducationPopupTool = function VeUiMwEducationPopupTool( config ) {
tool.$stillDot.hide(); tool.$stillDot.hide();
tool.popup.toggle( true ); tool.popup.toggle( true );
$shield.remove(); $shield.remove();
ve.track( 'activity.' + tool.constructor.static.name + 'EducationPopup', { action: 'show' } );
} }
} ); } );
}; };

View file

@ -25,12 +25,28 @@ ve.ui.MWPopupTool = function VeUiMWPopupTool( title, toolGroup, config ) {
ve.ui.MWPopupTool.super.call( this, toolGroup, config ); ve.ui.MWPopupTool.super.call( this, toolGroup, config );
this.$element.addClass( 've-ui-mwPopupTool' ); this.$element.addClass( 've-ui-mwPopupTool' );
this.$link.on( 'click', this.onToolLinkClick.bind( this ) );
}; };
/* Inheritance */ /* Inheritance */
OO.inheritClass( ve.ui.MWPopupTool, OO.ui.PopupTool ); OO.inheritClass( ve.ui.MWPopupTool, OO.ui.PopupTool );
/**
* Handle clicks on the main tool button.
*
* @param {jQuery.Event} e Click event
*/
ve.ui.MWPopupTool.prototype.onToolLinkClick = function () {
if ( this.popup.isVisible() ) {
// Popup will be visible if this just opened, thanks to sequencing.
// Can't just track this with toggle, because the notices popup is auto-opened and we
// want to know about deliberate interactions.
ve.track( 'activity.' + this.constructor.static.name + 'Popup', { action: 'show' } );
}
};
/** /**
* MediaWiki UserInterface notices popup tool. * MediaWiki UserInterface notices popup tool.
* *