Merge "TitleWidget: Use OOUI query highlighting, instead of jQuery lib"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 2 Oct 2017 16:36:49 +0000 (16:36 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 2 Oct 2017 16:36:49 +0000 (16:36 +0000)
resources/Resources.php
resources/src/mediawiki.widgets/mw.widgets.TitleOptionWidget.js

index f9590ec..235bb59 100644 (file)
@@ -2398,8 +2398,6 @@ return [
                        'mediawiki.Title',
                        'mediawiki.api',
                        'jquery.byteLimit',
-                       // TitleOptionWidget
-                       'jquery.highlightText',
                ],
                'messages' => [
                        // NamespaceInputWidget
index 51508ab..0f1815b 100644 (file)
@@ -21,7 +21,7 @@
         * @cfg {boolean} [missing] Page doesn't exist
         * @cfg {boolean} [redirect] Page is a redirect
         * @cfg {boolean} [disambiguation] Page is a disambiguation page
-        * @cfg {string} [query] Matching query string
+        * @cfg {string} [query] Matching query string to highlight
         */
        mw.widgets.TitleOptionWidget = function MwWidgetsTitleOptionWidget( config ) {
                var icon;
                } );
 
                // Highlight matching parts of link suggestion
-               this.$label
-                       .highlightText( config.query )
-                       .attr( 'title', config.data );
+               if ( config.query ) {
+                       this.setHighlightedQuery( config.data, config.query );
+               }
+               this.$label.attr( 'title', config.data );
 
                if ( config.missing ) {
                        this.$label.addClass( 'new' );