Phuedx has uploaded a new change for review.

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

Change subject: Hide search on Android 2.3 or less
......................................................................

Hide search on Android 2.3 or less

The search input isn't the input that's used in the SearchOverlay
overlay. In the click handler of the former the latter can't be
focussed to bring up the virtual keyboard, so hide the search form
elements for now.

Bug: T76882
Change-Id: Ic5a3a441f8a88587282e3eda5415ee874fc96a48
---
M includes/Resources.php
M javascripts/modules/search/init.js
2 files changed, 15 insertions(+), 1 deletion(-)


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

diff --git a/includes/Resources.php b/includes/Resources.php
index bdb35af..bd904d5 100644
--- a/includes/Resources.php
+++ b/includes/Resources.php
@@ -471,6 +471,7 @@
                        'mobile.overlays',
                        'mobile.templates',
                        'mobile.loggingSchemas',
+                       'jquery.client',
                ),
                'styles' => array(
                        'less/modules/search/SearchOverlay.less',
diff --git a/javascripts/modules/search/init.js 
b/javascripts/modules/search/init.js
index 8ebd9a4..e6fa486 100644
--- a/javascripts/modules/search/init.js
+++ b/javascripts/modules/search/init.js
@@ -1,7 +1,20 @@
 ( function ( M, $ ) {
 
        var SearchOverlay = M.require( 'modules/search/SearchOverlay' ),
-               schema = M.require( 'loggingSchemas/MobileWebClickTracking' );
+               schema = M.require( 'loggingSchemas/MobileWebClickTracking' ),
+               clientTest = {
+                       android: [ '>', 2.3 ]
+               };
+
+       if ( !$.client.test( clientTest ) ) {
+               // FIXME: $( '.search-box' ).hide() results in icons stretched 
to 50%
+               // of the window width in alpha.
+               $( '.search, .icon-search' )
+                       .prop( 'disabled', true )
+                       .hide();
+
+               return;
+       }
 
        //
        // don't use focus event 
(https://bugzilla.wikimedia.org/show_bug.cgi?id=47499)

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

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

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

Reply via email to