Merge "Fix event logging issues"

This commit is contained in:
Werdna 2015-01-20 22:14:40 +00:00 committed by Gerrit Code Review
commit 4685baed68
2 changed files with 13 additions and 4 deletions

View file

@ -46,7 +46,6 @@
event.preventDefault();
}
}
return false;
};
/**

View file

@ -65,8 +65,13 @@
mw.popups.render.render = function ( link, event ) {
// This will happen when the mouse goes from the popup box back to the
// anchor tag. In such a case, the timer to close the box is cleared.
if ( mw.popups.render.currentLink === link ) {
mw.popups.render.closeTimer.abort();
if (
mw.popups.render.currentLink &&
mw.popups.render.currentLink[0] === link[0]
) {
if ( mw.popups.render.closeTimer ) {
mw.popups.render.closeTimer.abort();
}
return;
}
@ -82,6 +87,7 @@
return;
}
mw.popups.render.currentLink = link;
link.on( 'mouseleave blur', mw.popups.render.leaveInactive );
@ -147,7 +153,7 @@
// Event logging
mw.popups.eventLogging.time = mw.now();
mw.popups.eventLogging.action = 'dismissed';
mw.popups.$popup.find( 'a.mwe-popups-extract' ).click( mw.popups.eventLogging.logClick );
mw.popups.$popup.find( 'a.mwe-popups-extract, a.mwe-popups-discreet' ).click( mw.popups.eventLogging.logClick );
link
.off( 'mouseleave blur', mw.popups.render.leaveInactive )
@ -163,6 +169,10 @@
* @method closePopup
*/
mw.popups.render.closePopup = function () {
if ( mw.popups.render.currentLink === undefined ) {
return false;
}
mw.popups.eventLogging.duration = mw.now() - mw.popups.eventLogging.time;
mw.popups.eventLogging.logEvent();