jenkins-bot has submitted this change and it was merged.

Change subject: Address Krinkle's review comments from I51c441d61
......................................................................


Address Krinkle's review comments from I51c441d61

See 
<https://gerrit.wikimedia.org/r/#/c/69161/1/modules/ve/init/mw/ve.init.mw.splitTest.js>.

Change-Id: I14442070c0998d724d67ec41cca813ef5bce2c19
---
M modules/ve/init/mw/ve.init.mw.splitTest.js
1 file changed, 11 insertions(+), 10 deletions(-)

Approvals:
  Krinkle: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/ve/init/mw/ve.init.mw.splitTest.js 
b/modules/ve/init/mw/ve.init.mw.splitTest.js
index 592c6f0..6ff9779 100644
--- a/modules/ve/init/mw/ve.init.mw.splitTest.js
+++ b/modules/ve/init/mw/ve.init.mw.splitTest.js
@@ -2,10 +2,6 @@
 ( function ( mw, $ ) {
        'use strict';
 
-       if ( !mw.config.get( 'wgVisualEditorConfig', {} ).enableEventLogging ) {
-               return;
-       }
-
        function log( action ) {
                var dfd = $.Deferred();
                setTimeout( dfd.reject, 1000 );
@@ -25,29 +21,34 @@
                return dfd;
        }
 
+       if ( !mw.config.get( 'wgVisualEditorConfig', {} ).enableEventLogging ) {
+               return;
+       }
+
        mw.hook( 'postEdit' ).add( function () {
                log( 'page-save-success' );
        } );
 
-       if ( mw.config.get('wgAction') === 'edit' ) {
+       if ( mw.config.get( 'wgAction' ) === 'edit' ) {
                log( 'page-edit-impression' );
        }
 
        // Log clicks on page edit and section edit links
        $( '#ca-edit a, .mw-editsection a' ).on( 'click', function ( e ) {
-               var href = this.href,
-                       action = /section=/.test( href ) ? 
'section-edit-link-click' : 'edit-link-click';
+               var el = this,
+                       action = /section=/.test( el.href ) ? 
'section-edit-link-click' : 'edit-link-click';
+
                log( action ).always( function () {
-                       window.location = href;
+                       window.location = el.href;
                } );
                e.preventDefault();
        } );
 
        // Log edit submit
        $( '#wpSave' ).one( 'click', function ( e ) {
-               var $save = $( this );
+               var el = this;
                log( 'page-save-attempt' ).always( function () {
-                       $save.trigger( 'click' );
+                       $( el ).trigger( 'click' );
                } );
                e.preventDefault();
        } );

-- 
To view, visit https://gerrit.wikimedia.org/r/69265
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I14442070c0998d724d67ec41cca813ef5bce2c19
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to