Jdlrobson has uploaded a new change for review.

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

Change subject: Push microtap to stable.
......................................................................

Push microtap to stable.

Remove 300ms delay on iOS

Bug: 46012
Change-Id: I3fb60e9d491261dfe0b3694e90a4883a369394a9
---
M includes/Resources.php
M javascripts/Drawer.js
M javascripts/Overlay.js
M javascripts/application.js
M javascripts/externals/micro.tap.js
M javascripts/loggingSchemas/MobileWebClickTracking.js
M javascripts/loggingSchemas/mobileWebCta.js
M javascripts/mainmenu.js
M javascripts/modules/editor/EditorOverlay.js
M javascripts/modules/editor/EditorOverlayBase.js
M javascripts/modules/editor/editor.js
M javascripts/modules/languages/languages.js
M javascripts/modules/mediaViewer/init.js
M javascripts/modules/notifications/notifications.js
M javascripts/modules/search/SearchOverlay.js
M javascripts/modules/search/search.js
M javascripts/modules/talk/TalkSectionAddOverlay.js
M javascripts/modules/talk/TalkSectionOverlay.js
M javascripts/modules/toc/toc.js
M javascripts/modules/toggling/toggle.js
M javascripts/modules/tutorials/newbieEditor.js
M javascripts/modules/uploads/PhotoUploadOverlay.js
M javascripts/modules/uploads/PhotoUploadProgress.js
M javascripts/modules/uploads/UploadTutorial.js
M tests/qunit/modules/toggling/test_toggle.js
25 files changed, 48 insertions(+), 71 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/02/164402/1

diff --git a/includes/Resources.php b/includes/Resources.php
index d229a1f..383693d 100644
--- a/includes/Resources.php
+++ b/includes/Resources.php
@@ -414,7 +414,6 @@
                        'mobile.wikigrok',
                ),
                'scripts' => array(
-                       'javascripts/externals/micro.tap.js',
                        'javascripts/modules/languages/preferred.js',
                ),
                'position' => 'bottom',
@@ -610,6 +609,7 @@
                        'ctaDrawer.hogan',
                ),
                'scripts' => array(
+                       'javascripts/externals/micro.tap.js',
                        'javascripts/modules/routes.js',
                        'javascripts/Drawer.js',
                        'javascripts/CtaDrawer.js',
diff --git a/javascripts/Drawer.js b/javascripts/Drawer.js
index ca18f3f..28209ab 100644
--- a/javascripts/Drawer.js
+++ b/javascripts/Drawer.js
@@ -17,12 +17,11 @@
                        Panel.prototype.postRender.apply( this, arguments );
                        this.on( 'show', function() {
                                setTimeout( function() {
-                                       $( 'body' ).one( M.tapEvent( 'click' ) 
+ '.drawer', $.proxy( self, 'hide' ) );
+                                       $( 'body' ).one( 'tap.drawer', $.proxy( 
self, 'hide' ) );
                                        $( window ).one( 'scroll.drawer', 
$.proxy( self, 'hide' ) );
-                                       // FIXME change when micro.tap.js in 
stable
                                        // can't use 'body' because the drawer 
will be closed when
                                        // tapping on it and clicks will be 
prevented
-                                       $( '#mw-mf-page-center' ).one( 
M.tapEvent( 'click' ) + '.drawer', $.proxy( self, 'hide' ) );
+                                       $( '#mw-mf-page-center' ).one( 
'tap.drawer', $.proxy( self, 'hide' ) );
                                }, self.minHideDelay );
                        } );
 
@@ -34,7 +33,7 @@
                        } );
 
                        // Allow the drawer itself to be clickable (e.g. for 
copying and pasting references / clicking links in reference)
-                       this.$el.on( M.tapEvent( 'click' ), function( ev ) {
+                       this.$el.on( 'tap', function( ev ) {
                                ev.stopPropagation();
                        } );
                }
diff --git a/javascripts/Overlay.js b/javascripts/Overlay.js
index 438dd3b..9d354be 100644
--- a/javascripts/Overlay.js
+++ b/javascripts/Overlay.js
@@ -59,8 +59,7 @@
 
                        // Truncate any text inside in the overlay header.
                        this.$( '.overlay-header h2 span' ).addClass( 
'truncated-text' );
-                       // FIXME change when micro.tap.js in stable
-                       this.$( '.cancel, .confirm' ).on( M.tapEvent( 'click' 
), function( ev ) {
+                       this.$( '.cancel, .confirm' ).on( 'tap', function( ev ) 
{
                                ev.preventDefault();
                                ev.stopPropagation();
                                if ( self.closeOnBack ) {
@@ -71,7 +70,7 @@
                        } );
                        // stop clicks in the overlay from propagating to the 
page
                        // (prevents non-fullscreen overlays from being closed 
when they're tapped)
-                       this.$el.on( M.tapEvent( 'click' ), function( ev ) {
+                       this.$el.on( 'tap', function( ev ) {
                                ev.stopPropagation();
                        } );
 
@@ -134,7 +133,7 @@
                        }
 
                        if ( this.closeOnContentTap ) {
-                               $( '#mw-mf-page-center' ).one( M.tapEvent( 
'click' ), $.proxy( this, 'hide' ) );
+                               $( '#mw-mf-page-center' ).one( 'tap', $.proxy( 
this, 'hide' ) );
                        }
 
                        // prevent scrolling and bouncing outside of 
.overlay-content
diff --git a/javascripts/application.js b/javascripts/application.js
index 6f023e2..001b3b3 100644
--- a/javascripts/application.js
+++ b/javascripts/application.js
@@ -454,16 +454,7 @@
                /**
                 * @type {Boolean}
                 */
-               isTestA: mw.config.get( 'wgUserId' ) % 2 === 0,
-               // FIXME: get rid off this (grep M.tapEvent) when micro.tap.js 
is in stable
-               /**
-                * @method
-                * @param {String} fallbackEvent
-                * @return {String}
-                */
-               tapEvent: function( fallbackEvent ) {
-                       return M.isBetaGroupMember() ? 'tap' : fallbackEvent;
-               }
+               isTestA: mw.config.get( 'wgUserId' ) % 2 === 0
        } );
 
        // Initialize
diff --git a/javascripts/externals/micro.tap.js 
b/javascripts/externals/micro.tap.js
index adae9df..1cfb8d8 100644
--- a/javascripts/externals/micro.tap.js
+++ b/javascripts/externals/micro.tap.js
@@ -1,5 +1,9 @@
 /**
  * micro.tap
+ * Makes tap event available in jQuery.
+ * This can be used to beat the 300ms delay that plagues iOS Safari.
+ * @see https://developers.google.com/mobile/articles/fast_buttons
+ * Note: Surplus in Chrome 32 
(http://updates.html5rocks.com/2013/12/300ms-tap-delay-gone-away)
  * https://github.com/jgonera/micro.tap
  */
 
diff --git a/javascripts/loggingSchemas/MobileWebClickTracking.js 
b/javascripts/loggingSchemas/MobileWebClickTracking.js
index a407c95..5b87a57 100644
--- a/javascripts/loggingSchemas/MobileWebClickTracking.js
+++ b/javascripts/loggingSchemas/MobileWebClickTracking.js
@@ -23,7 +23,7 @@
        }
 
        function hijackLink( selector, name ) {
-               $( selector ).on( M.tapEvent( 'click' ), function() {
+               $( selector ).on( 'tap', function() {
                        futureLog( name, $( this ).attr( 'href' ) );
                } );
        }
diff --git a/javascripts/loggingSchemas/mobileWebCta.js 
b/javascripts/loggingSchemas/mobileWebCta.js
index 7e59ccb..ca91705 100644
--- a/javascripts/loggingSchemas/mobileWebCta.js
+++ b/javascripts/loggingSchemas/mobileWebCta.js
@@ -33,7 +33,7 @@
                                window.location.href = href;
                        } );
                }
-               $el.on( M.tapEvent( 'click' ), linkHandler );
+               $el.on( 'tap', linkHandler );
        }
 
        M.define( 'loggingSchemas/mobileWebCta', {
diff --git a/javascripts/mainmenu.js b/javascripts/mainmenu.js
index 8d36578..52c8167 100644
--- a/javascripts/mainmenu.js
+++ b/javascripts/mainmenu.js
@@ -25,14 +25,10 @@
        }
 
        function initialize() {
-               // FIXME: duplicate code in application.js which is not 
available here.
-               var tapEvent = M.isBetaGroupMember() ? 'tap' : 'click';
-
                // make the input readonly to avoid accidental focusing when 
closing menu
                // (when JS is on, this input should not be used for typing 
anyway)
                $( '#searchInput' ).prop( 'readonly', true );
-               // FIXME change when micro.tap.js in stable
-               $( '#mw-mf-main-menu-button' ).on( tapEvent, function( ev ) {
+               $( '#mw-mf-main-menu-button' ).on( 'tap', function( ev ) {
                        if ( isOpen() ) {
                                closeNavigationDrawers();
                        } else {
@@ -40,13 +36,10 @@
                        }
                        ev.preventDefault();
                        ev.stopPropagation();
-               // Hack: See bug 64669 iOS has a hover bug
-               // Adding an empty touchend event seems to fix this
-               // FIXME: Remove when using tapEvent in stable
-               } ).on( 'touchend', function() {} );
+               } );
 
                // close navigation if content tapped
-               $( '#mw-mf-page-center' ).on( tapEvent, function(ev) {
+               $( '#mw-mf-page-center' ).on( 'tap', function(ev) {
                        if ( isOpen() ) {
                                closeNavigationDrawers();
                                ev.preventDefault();
diff --git a/javascripts/modules/editor/EditorOverlay.js 
b/javascripts/modules/editor/EditorOverlay.js
index 860a97f..5b83f95 100644
--- a/javascripts/modules/editor/EditorOverlay.js
+++ b/javascripts/modules/editor/EditorOverlay.js
@@ -59,10 +59,10 @@
                                this.$anonWarning = this.$( '.anonwarning' );
                                this._showAnonWarning( options );
                        } else {
-                               this.$( '.continue' ).on( M.tapEvent( 'click' 
), $.proxy( this, '_prepareForSave' ) );
+                               this.$( '.continue' ).on( 'tap', $.proxy( this, 
'_prepareForSave' ) );
                        }
-                       this.$( '.back' ).on( M.tapEvent( 'click' ), $.proxy( 
this, '_hidePreview' ) );
-                       this.$( '.submit' ).on( M.tapEvent( 'click' ), $.proxy( 
this, '_save' ) );
+                       this.$( '.back' ).on( 'tap', $.proxy( this, 
'_hidePreview' ) );
+                       this.$( '.submit' ).on( 'tap', $.proxy( this, '_save' ) 
);
                        // make license links open in separate tabs
                        this.$( '.license a' ).attr( 'target', '_blank' );
 
@@ -108,8 +108,7 @@
                                        mw.util.getUrl( 'Special:UserLogin', 
$.extend( params, signupParams ) )
                                ).parse()
                        ).show();
-                       this.$( '.continue' ).prop( 'disabled', false ).on(
-                               M.tapEvent( 'click' ), $.proxy( this, 
'_showEditorafterWarning' )
+                       this.$( '.continue' ).prop( 'disabled', false ).on( 
'tap', $.proxy( this, '_showEditorafterWarning' )
                        );
                        this.clearSpinner();
                },
@@ -117,8 +116,7 @@
                _showEditorafterWarning: function() {
                        this.showSpinner();
                        this.$anonWarning.hide();
-                       this.$( '.continue' ).prop( 'disabled', true ).on(
-                               M.tapEvent( 'click' ), $.proxy( this, 
'_prepareForSave' )
+                       this.$( '.continue' ).prop( 'disabled', true ).on( 
'tap', $.proxy( this, '_prepareForSave' )
                        );
                        this._loadContent();
                },
diff --git a/javascripts/modules/editor/EditorOverlayBase.js 
b/javascripts/modules/editor/EditorOverlayBase.js
index 2ce44d3..6b706b0 100644
--- a/javascripts/modules/editor/EditorOverlayBase.js
+++ b/javascripts/modules/editor/EditorOverlayBase.js
@@ -181,7 +181,7 @@
                        // log edit attempt
                        this.log( 'attempt' );
 
-                       this.$( '.cancel' ).on( M.tapEvent( 'click' ), 
function() {
+                       this.$( '.cancel' ).on( 'tap', function() {
                                // log cancel attempt
                                self.log( 'cancel' );
                        } );
diff --git a/javascripts/modules/editor/editor.js 
b/javascripts/modules/editor/editor.js
index 0161909..017d162 100644
--- a/javascripts/modules/editor/editor.js
+++ b/javascripts/modules/editor/editor.js
@@ -47,8 +47,7 @@
                                href: $el[0].href, selector: 'edit-anon' } ];
                }
                $el.
-                       // FIXME change when micro.tap.js in stable
-                       on( M.tapEvent( 'mouseup' ), function( ev ) {
+                       on( 'tap', function( ev ) {
                                ev.preventDefault();
                                // prevent folding section when clicking Edit
                                ev.stopPropagation();
@@ -161,8 +160,7 @@
                        }
                }
 
-               // FIXME change when micro.tap.js in stable
-               $( '.edit-page' ).on( M.tapEvent( 'mouseup' ), function( ev ) {
+               $( '.edit-page' ).on( 'tap', function( ev ) {
                        // prevent folding section when clicking Edit
                        ev.stopPropagation();
                } );
@@ -189,8 +187,7 @@
                } else {
                        M.getCurrentPage().isEditable( user ).done( function( 
isEditable ) {
                                if ( isEditable ) {
-                                       // FIXME: change when micro.tap.js in 
stable
-                                       $( '#ca-edit' ).addClass( 'enabled' 
).on( M.tapEvent( 'click' ), function() {
+                                       $( '#ca-edit' ).addClass( 'enabled' 
).on( 'tap', function() {
                                                drawer.render().show();
                                        });
                                } else {
@@ -213,7 +210,7 @@
         * @param {string} msg Message key for sorry message
         */
        function showSorryToast( msg ) {
-               $( '#ca-edit, .edit-page' ).on( M.tapEvent( 'click' ), 
function( ev ) {
+               $( '#ca-edit, .edit-page' ).on( 'tap', function( ev ) {
                        popup.show( mw.msg( msg ), 'toast' );
                        ev.preventDefault();
                } );
diff --git a/javascripts/modules/languages/languages.js 
b/javascripts/modules/languages/languages.js
index b683e2b..b2fbfb1 100644
--- a/javascripts/modules/languages/languages.js
+++ b/javascripts/modules/languages/languages.js
@@ -26,7 +26,7 @@
         * that displays the same data
         */
        function initButton() {
-               $( '#page-secondary-actions .languageSelector' ).on( 
M.tapEvent( 'click' ), function( ev ) {
+               $( '#page-secondary-actions .languageSelector' ).on( 'tap', 
function( ev ) {
                        ev.preventDefault();
                        M.router.navigate( '/languages' );
                        MobileWebClickTracking.log( 'languages' );
diff --git a/javascripts/modules/mediaViewer/init.js 
b/javascripts/modules/mediaViewer/init.js
index 7b9fa36..ecee4f7 100644
--- a/javascripts/modules/mediaViewer/init.js
+++ b/javascripts/modules/mediaViewer/init.js
@@ -6,7 +6,7 @@
 
                                if ( match ) {
                                        $a.off();
-                                       $a.on( M.tapEvent( 'click' ), function( 
ev ) {
+                                       $a.on( 'tap', function( ev ) {
                                                ev.preventDefault();
                                                M.router.navigate( '#/image/' + 
match[0] );
                                        } );
diff --git a/javascripts/modules/notifications/notifications.js 
b/javascripts/modules/notifications/notifications.js
index 4fd2801..8243518 100644
--- a/javascripts/modules/notifications/notifications.js
+++ b/javascripts/modules/notifications/notifications.js
@@ -28,7 +28,7 @@
        // Once the DOM is loaded hijack the notifications button to display an 
overlay rather
        // than linking to Special:Notifications.
        $( function () {
-               $btn.on( M.tapEvent( 'click' ), function() {
+               $btn.on( 'tap', function() {
                        M.router.navigate( '#/notifications' );
                        // Important that we also prevent propagation to avoid 
interference with events that may be
                        // binded on #mw-mf-page-center that close overlay
@@ -55,7 +55,7 @@
                                        $( '#mw-mf-page-center' ).off( 
'.secondary' );
                                });
 
-                               $( '#mw-mf-page-center' ).one( M.tapEvent( 
'click' ) + '.secondary', function() {
+                               $( '#mw-mf-page-center' ).one( 'tap.secondary', 
function() {
                                        M.router.back();
                                } );
                        } );
diff --git a/javascripts/modules/search/SearchOverlay.js 
b/javascripts/modules/search/SearchOverlay.js
index 599791c..f0ecfc7 100644
--- a/javascripts/modules/search/SearchOverlay.js
+++ b/javascripts/modules/search/SearchOverlay.js
@@ -58,7 +58,7 @@
                        } );
 
                        // initialize the button that clears the search field
-                       $clear.hide().on( M.tapEvent( 'click' ), function() {
+                       $clear.hide().on( 'tap', function() {
                                self.$input.val( '' ).focus();
                                self.performSearch();
                                $clear.hide();
@@ -69,7 +69,7 @@
                                hide().
                                // can't use $.proxy because it would pass ev 
to submit() which would
                                // be treated as alternative form data
-                               on( M.tapEvent( 'click' ), function() {
+                               on( 'tap', function() {
                                        window.history.back();
                                        // Add fulltext input to force fulltext 
search
                                        $( '<input>' )
@@ -80,10 +80,10 @@
 
                        // tapping on background only should hide the overlay
                        this.$overlayContent
-                               .on( M.tapEvent( 'click' ), function() {
+                               .on( 'tap', function() {
                                        window.history.back();
                                } )
-                               .find( '> div' ).on( M.tapEvent( 'click' ), 
function( ev ) {
+                               .find( '> div' ).on( 'tap', function( ev ) {
                                        ev.stopPropagation();
                                } );
 
diff --git a/javascripts/modules/search/search.js 
b/javascripts/modules/search/search.js
index b036a7e..e92bcb3 100644
--- a/javascripts/modules/search/search.js
+++ b/javascripts/modules/search/search.js
@@ -9,7 +9,7 @@
        // focus() (see SearchOverlay#show) opens virtual keyboard only if 
triggered
        // from user context event, so using it in route callback won't work
        // 
http://stackoverflow.com/questions/6837543/show-virtual-keyboard-on-mobile-phones-in-javascript
-       $( '#searchInput' ).on( M.tapEvent( 'touchend mouseup' ), function() {
+       $( '#searchInput' ).on( 'tap', function() {
                new SearchOverlay( { searchTerm: $( this ).val() } ).show();
                M.router.navigate( '/search' );
        } );
diff --git a/javascripts/modules/talk/TalkSectionAddOverlay.js 
b/javascripts/modules/talk/TalkSectionAddOverlay.js
index ebcf2c1..6e06536 100644
--- a/javascripts/modules/talk/TalkSectionAddOverlay.js
+++ b/javascripts/modules/talk/TalkSectionAddOverlay.js
@@ -41,7 +41,7 @@
                postRender: function( options ) {
                        var self = this;
                        Overlay.prototype.postRender.call( this, options );
-                       this.$( '.back' ).on( M.tapEvent( 'click' ), $.proxy( 
self, 'hide' ) );
+                       this.$( '.back' ).on( 'tap', $.proxy( self, 'hide' ) );
                        this.confirm = this.$( 'button.confirm-save' );
                        this.confirm.on( 'click', function() {
                                if ( !$( this ).prop( 'disabled' ) ) {
diff --git a/javascripts/modules/talk/TalkSectionOverlay.js 
b/javascripts/modules/talk/TalkSectionOverlay.js
index d949d6b..607a52d 100644
--- a/javascripts/modules/talk/TalkSectionOverlay.js
+++ b/javascripts/modules/talk/TalkSectionOverlay.js
@@ -42,7 +42,7 @@
                        var self = this, $comment = this.$( '.comment' ),
                                $textarea = $comment.find( 'textarea' );
                        Overlay.prototype.postRender.apply( this, arguments );
-                       this.$( '.back' ).on( M.tapEvent( 'click' ), $.proxy( 
self, 'hide' ) );
+                       this.$( '.back' ).on( 'tap', $.proxy( self, 'hide' ) );
                        this.$( '.loading' ).remove();
                        if ( user.isAnon() || !M.isAlphaGroupMember() ) {
                                $comment.remove();
diff --git a/javascripts/modules/toc/toc.js b/javascripts/modules/toc/toc.js
index fda92bb..6f0c9f1 100644
--- a/javascripts/modules/toc/toc.js
+++ b/javascripts/modules/toc/toc.js
@@ -17,7 +17,7 @@
                        var log = MobileWebClickTracking.log;
                        View.prototype.postRender.apply( this, arguments );
                        // Click tracking for table of contents so we can see 
if people interact with it
-                       this.$( 'h2' ).on( toggle.eventName, function() {
+                       this.$( 'h2' ).on( 'tap', function() {
                                log( 'page-toc-toggle' );
                        } );
                        this.$( 'a' ).on( 'click', function() {
diff --git a/javascripts/modules/toggling/toggle.js 
b/javascripts/modules/toggling/toggle.js
index 614fc75..27a022d 100644
--- a/javascripts/modules/toggling/toggle.js
+++ b/javascripts/modules/toggling/toggle.js
@@ -1,6 +1,4 @@
 ( function( M, $ ) {
-       var eventName = M.tapEvent( 'mouseup' );
-
        /**
         * Given a heading, toggle it and any of its children
         *
@@ -105,8 +103,7 @@
                                'aria-haspopup': 'true',
                                'aria-controls': id
                        } )
-                       // FIXME change when micro.tap.js in stable
-                       .on( eventName, function( ev ) {
+                       .on( 'tap', function( ev ) {
                                // prevent taps/clicks on edit button after 
toggling (bug 56209)
                                ev.preventDefault();
                                toggle( $( this ) );
@@ -150,7 +147,6 @@
        } );
 
        M.define( 'toggle', {
-               eventName: eventName,
                reveal: reveal,
                toggle: toggle,
                enable: init
diff --git a/javascripts/modules/tutorials/newbieEditor.js 
b/javascripts/modules/tutorials/newbieEditor.js
index 5ce23cf..424407e 100644
--- a/javascripts/modules/tutorials/newbieEditor.js
+++ b/javascripts/modules/tutorials/newbieEditor.js
@@ -54,7 +54,7 @@
                editOverlay.show();
                $( '#ca-edit' ).on( 'mousedown', $.proxy( editOverlay, 'hide' ) 
);
                // Initialize the 'Start editing' button
-               editOverlay.$( '.actionable' ).on( M.tapEvent( 'click' ), 
function() {
+               editOverlay.$( '.actionable' ).on( 'tap', function() {
                        // Hide the tutorial
                        editOverlay.hide();
                        // Load the editing interface by changing the URL hash
diff --git a/javascripts/modules/uploads/PhotoUploadOverlay.js 
b/javascripts/modules/uploads/PhotoUploadOverlay.js
index 078f08d..43cfa3f 100644
--- a/javascripts/modules/uploads/PhotoUploadOverlay.js
+++ b/javascripts/modules/uploads/PhotoUploadOverlay.js
@@ -161,7 +161,7 @@
 
                        $submitButton = this.$( '.submit' ).
                                prop( 'disabled', true ).
-                               on( M.tapEvent( 'click' ), function() {
+                               on( 'tap', function() {
                                        self.log( { action: 'previewSubmit' } );
                                        self._submit();
                                } );
diff --git a/javascripts/modules/uploads/PhotoUploadProgress.js 
b/javascripts/modules/uploads/PhotoUploadProgress.js
index 0969799..f87bff7 100644
--- a/javascripts/modules/uploads/PhotoUploadProgress.js
+++ b/javascripts/modules/uploads/PhotoUploadProgress.js
@@ -19,7 +19,7 @@
 
                postRender: function() {
                        Overlay.prototype.postRender.apply( this, arguments );
-                       this.$( '.submit' ).on( M.tapEvent( 'click' ), $.proxy( 
this, 'emit', 'submit' ) );
+                       this.$( '.submit' ).on( 'tap', $.proxy( this, 'emit', 
'submit' ) );
                },
 
                showAbuseFilter: function( type, message ) {
diff --git a/javascripts/modules/uploads/UploadTutorial.js 
b/javascripts/modules/uploads/UploadTutorial.js
index ab0b60b..7c46438 100644
--- a/javascripts/modules/uploads/UploadTutorial.js
+++ b/javascripts/modules/uploads/UploadTutorial.js
@@ -45,8 +45,8 @@
 
                        this.page = 0;
                        this.totalPages = options.pages.length;
-                       this.$( '.prev' ).on( M.tapEvent( 'click' ), $.proxy( 
this, 'previous' ) );
-                       this.$( '.next' ).on( M.tapEvent( 'click' ), $.proxy( 
this, 'next' ) );
+                       this.$( '.prev' ).on( 'tap', $.proxy( this, 'previous' 
) );
+                       this.$( '.next' ).on( 'tap', $.proxy( this, 'next' ) );
 
                        this._showCurrentPage();
 
diff --git a/tests/qunit/modules/toggling/test_toggle.js 
b/tests/qunit/modules/toggling/test_toggle.js
index 704fcc8..faa0395 100644
--- a/tests/qunit/modules/toggling/test_toggle.js
+++ b/tests/qunit/modules/toggling/test_toggle.js
@@ -65,7 +65,7 @@
 
        strictEqual( $content.hasClass( 'openSection' ), false, 'check content 
is hidden at start' );
 
-       $( '#section_1' ).trigger( M.tapEvent( 'mouseup' ) );
+       $( '#section_1' ).trigger( 'tap' );
 
        strictEqual( $content.hasClass( 'openSection' ), true, 'check content 
is shown on a toggle' );
 } );
@@ -80,13 +80,13 @@
        strictEqual( $content.attr( 'aria-expanded' ), 'false', 'check 
aria-expanded is false at start' );
 
        // Test what the toggle() function gives us when hiding the section
-       $section.trigger( M.tapEvent( 'mouseup' ) );
+       $section.trigger( 'tap' );
        strictEqual( $content.hasClass( 'openSection' ), true, 'check content 
is visible after toggling' );
        strictEqual( $content.attr( 'aria-pressed' ), 'true', 'check 
aria-pressed is true after toggling' );
        strictEqual( $content.attr( 'aria-expanded' ), 'true', 'check 
aria-expanded is true after toggling' );
 
        // Test what the toggle() function gives us when showing the section
-       $section.trigger( M.tapEvent( 'mouseup' ) );
+       $section.trigger( 'tap' );
        strictEqual( $content.hasClass( 'openSection' ), false, 'check content 
is hidden after toggling' );
        strictEqual( $content.attr( 'aria-pressed' ), 'false', 'check 
aria-pressed is false after toggling' );
        strictEqual( $content.attr( 'aria-expanded' ), 'false', 'check 
aria-expanded is false after toggling' );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3fb60e9d491261dfe0b3694e90a4883a369394a9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>

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

Reply via email to