Ori.livneh has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/69265


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, 9 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/65/69265/1

diff --git a/modules/ve/init/mw/ve.init.mw.splitTest.js 
b/modules/ve/init/mw/ve.init.mw.splitTest.js
index 592c6f0..7a50f83 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,32 @@
                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: newchange
Gerrit-Change-Id: I14442070c0998d724d67ec41cca813ef5bce2c19
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <[email protected]>

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

Reply via email to