mediawiki.searchSuggest: Enable for iPhone and iPod touch
[lhc/web/wiklou.git] / resources / src / mediawiki / mediawiki.searchSuggest.js
index c2c70b0..a214cb3 100644 (file)
@@ -22,8 +22,9 @@
                        konqueror: [['>=', '4.11']],
                        docomo: false,
                        blackberry: false,
-                       ipod: false,
-                       iphone: false
+                       // Support for iOS 6 or higher. It has not been tested on iOS 5 or lower
+                       ipod: [['>=', 6]],
+                       iphone: [['>=', 6]]
                };
 
                if ( !$.client.test( map ) ) {
@@ -66,6 +67,7 @@
                                .wrap(
                                        $( '<a>' )
                                                .attr( 'href', resultRenderCache.baseHref + $.param( resultRenderCache.linkParams ) )
+                                               .attr( 'title', text )
                                                .addClass( 'mw-searchSuggest-link' )
                                );
                }
                ];
                $( searchboxesSelectors.join( ', ' ) )
                        .suggestions( {
-                               fetch: function ( query ) {
-                                       var $textbox = this,
-                                               node = this[0];
+                               fetch: function ( query, response ) {
+                                       var node = this[0];
 
                                        api = api || new mw.Api();
 
                                                namespace: 0,
                                                suggest: ''
                                        } ).done( function ( data ) {
-                                               $textbox.suggestions( 'suggestions', data[1] );
+                                               response( data[ 1 ] );
                                        } ) );
                                },
                                cancel: function () {
                                                return true;
                                        }
                                },
-                               delay: 120,
+                               cache: true,
                                highlightInput: true
                        } )
                        .bind( 'paste cut drop', function () {