TitleWidget: Use OOUI query highlighting, instead of jQuery lib
[lhc/web/wiklou.git] / resources / src / mediawiki.widgets / mw.widgets.TitleOptionWidget.js
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' );