mediawiki.widgets: Remove autoEllipsis() from TitleOptionWidget
authorTimo Tijhof <krinklemail@gmail.com>
Sat, 18 Mar 2017 00:04:12 +0000 (17:04 -0700)
committerTimo Tijhof <krinklemail@gmail.com>
Mon, 20 Mar 2017 17:55:49 +0000 (10:55 -0700)
Redundant with CSS 'text-overflow: ellipsis', which is already applied.

Aside from ellipsis overflow, autoEllipsis() was also serving as indirect
caller of `highlightText( option.matchText )` and `attr('title')`,
which we want to keep, so leave that in its place.

Bug: T160804
Change-Id: I550183750d66d769cc9c960150a2349d1b9181aa

resources/Resources.php
resources/src/mediawiki.widgets/mw.widgets.TitleOptionWidget.js

index 392cdb3..4ce326d 100644 (file)
@@ -2253,7 +2253,7 @@ return [
                        'mediawiki.api',
                        'jquery.byteLimit',
                        // TitleOptionWidget
                        'mediawiki.api',
                        'jquery.byteLimit',
                        // TitleOptionWidget
-                       'jquery.autoEllipsis',
+                       'jquery.highlightText',
                ],
                'messages' => [
                        // NamespaceInputWidget
                ],
                'messages' => [
                        // NamespaceInputWidget
index 37e6e1a..3583e5e 100644 (file)
@@ -65,7 +65,9 @@
                } );
 
                // Highlight matching parts of link suggestion
                } );
 
                // Highlight matching parts of link suggestion
-               this.$label.autoEllipsis( { hasSpan: false, tooltip: true, matchText: config.query } );
+               this.$label
+                       .highlightText( config.query )
+                       .attr( 'title', config.data );
 
                if ( config.missing ) {
                        this.$label.addClass( 'new' );
 
                if ( config.missing ) {
                        this.$label.addClass( 'new' );