Bmansurov has uploaded a new change for review.

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

Change subject: Make the search input selector more specific
......................................................................

Make the search input selector more specific

Although minerva modules should not be loaded in other skins,
Gather does so nevertheless. This was interfering with the desktop
skin search bar and causing JS errors. The patch is a temporary
solution until Gather stops using mobile modules in Desktop.

Bug: T121946
Change-Id: I73937b1647fa38f80eedc15f2c4a5837d80b7621
---
M resources/skins.minerva.scripts/search.js
1 file changed, 7 insertions(+), 3 deletions(-)


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

diff --git a/resources/skins.minerva.scripts/search.js 
b/resources/skins.minerva.scripts/search.js
index a96930f..1341443 100644
--- a/resources/skins.minerva.scripts/search.js
+++ b/resources/skins.minerva.scripts/search.js
@@ -10,7 +10,11 @@
                        modules: [ 'mobile.search.api', 'mobile.search' ],
                        api: 'mobile.search.api/SearchGateway',
                        overlay: 'mobile.search/SearchOverlay'
-               };
+               },
+               // IMPORTANT: keep body.skin-minerva (as the search overlay 
interfering with
+               // Desktop search) until Gather stops loading this file on 
Desktop
+               // See https://phabricator.wikimedia.org/T121946
+               $searchInput = $( 'body.skin-minerva' ).find( '#searchInput' );
 
        /**
         * Reveal the search overlay
@@ -47,7 +51,7 @@
                searchPlaceholderMsg = 'mobile-frontend-placeholder-beta';
        }
 
-       $( '#searchInput' ).attr( 'placeholder', mw.message( 
searchPlaceholderMsg ) );
+       $searchInput.attr( 'placeholder', mw.message( searchPlaceholderMsg ) );
 
        // See https://phabricator.wikimedia.org/T76882 for why we disable 
search on Android 2
        if ( browser.isAndroid2() ) {
@@ -58,7 +62,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( 'click', openSearchOverlay )
+               $searchInput.on( 'click', openSearchOverlay )
                        // Apparently needed for main menu to work correctly.
                        .prop( 'readonly', true );
        }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I73937b1647fa38f80eedc15f2c4a5837d80b7621
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Bmansurov <bmansu...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to