jquery.suggestions: Improve comment about avoiding click interference
authorTimo Tijhof <krinklemail@gmail.com>
Thu, 17 Dec 2015 19:52:39 +0000 (11:52 -0800)
committerTimo Tijhof <krinklemail@gmail.com>
Sat, 19 Dec 2015 06:16:10 +0000 (22:16 -0800)
Change-Id: I971f6163f08cd419c29cac372157c0336b5fd132

resources/src/jquery/jquery.suggestions.js
resources/src/mediawiki.widgets/mw.widgets.TitleOptionWidget.js

index 719eacb..01d9a43 100644 (file)
                                                                if ( $result.get( 0 ) !== $other.get( 0 ) ) {
                                                                        return;
                                                                }
-                                                               // Do not interfere with non-left clicks or if modifier keys are pressed (e.g. ctrl-click).
+                                                               // 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 ) ) {
                                                                        $.suggestions.highlight( context, $result, true );
                                                                        if ( typeof context.config.result.select === 'function' ) {
                                                                if ( $special.get( 0 ) !== $other.get( 0 ) ) {
                                                                        return;
                                                                }
-                                                               // Do not interfere with non-left clicks or if modifier keys are pressed (e.g. ctrl-click).
+                                                               // 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 ) ) {
                                                                        if ( typeof context.config.special.select === 'function' ) {
                                                                                context.config.special.select.call( $special, context.data.$textbox );
index 46960f5..84533aa 100644 (file)
@@ -53,7 +53,7 @@
 
                // Allow opening the link in new tab, but not regular navigation.
                this.$label.on( 'click', function ( e ) {
-                       // Do not interfere with non-left clicks or if modifier keys are pressed (e.g. ctrl-click).
+                       // 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();
                        }