Merge "Update OOjs UI to v0.17.3"
[lhc/web/wiklou.git] / resources / src / mediawiki.widgets / mw.widgets.TitleOptionWidget.js
index 138715a..84533aa 100644 (file)
                this.$label.attr( 'href', config.url );
                this.$element.addClass( 'mw-widget-titleOptionWidget' );
 
+               // Allow opening the link in new tab, but not regular navigation.
+               this.$label.on( 'click', function ( e ) {
+                       // Don't interfere with special clicks (e.g. to open in new tab)
+                       if ( !( e.which !== 1 || e.altKey || e.ctrlKey || e.shiftKey || e.metaKey ) ) {
+                               e.preventDefault();
+                       }
+               } );
+
                // Highlight matching parts of link suggestion
                this.$label.autoEllipsis( { hasSpan: false, tooltip: true, matchText: config.query } );
 
@@ -69,6 +77,7 @@
                                $( '<span>' )
                                        .addClass( 'mw-widget-titleOptionWidget-description' )
                                        .text( config.description )
+                                       .attr( 'title', config.description )
                        );
                }
        };